Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress check user against user roles

$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
    //The user has the "author" role
}
Comment

PREVIOUS NEXT
Code Example
Php :: php append to file 
Php :: laravel catch exception ex log save 
Php :: autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated. 
Php :: mac php ini file path 
Php :: php strip out special characters 
Php :: use of segment in laravel 8 
Php :: laravel storage hard link 
Php :: laravel order by desc 
Php :: php get string after character 
Php :: migrate single file in laravel 
Php :: opencart order change status 
Php :: php get type of object 
Php :: php loop through lines of file 
Php :: CLI to create a new laravel project 
Php :: php convert spaces to underscores 
Php :: write if and else in one line laravel 
Php :: php add hours to current date 
Php :: number format comma php 
Php :: php code for getting the next day 
Php :: php get array average 
Php :: enie letter validation laravel regex 
Php :: php get ip to location 
Php :: add 7 days to date php 
Php :: php timestamp to date 
Php :: error log array 
Php :: how to check the laravel version mac 
Php :: print all session in codeigniter 
Php :: get http referer php 
Php :: laravel validate number to be at least 3 digits 
Php :: wordpress get username 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =