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

get users by role wordpress

$getDealers = get_users( 
					array(
						'role'         => 'dealership',
						'orderby'      => 'nickname'
					)
				);
				
				if($getDealers) {			
					foreach($getDealers as $getDealer) {
						if($getDealer->ID == $new_user_data->dealer){
							update_user_meta($new_user_id, 'yews_data_dealership_name', $getDealer->nickname);
						}
					}
				}
Comment

PREVIOUS NEXT
Code Example
Php :: explode foreach 
Php :: blade number format by comma 
Php :: ReflectionException: Class MagentoFrameworkAppHttpInterceptor does not exist in 
Php :: laravel validation number greater than 0 
Php :: BCMath PHP Extension 
Php :: php filter_var boolean 
Php :: laravel command to create symlink storage 
Php :: how to add two array in single array without repetation in php 
Php :: Non-static method BarryvdhDomPDFPDF::loadView() should not be called statically 
Php :: laravel running a specific migration on different path 
Php :: php if no imagee exists 
Php :: php remove null bytes from string 
Php :: execute artisan command from route 
Php :: create laravel project with composer 
Php :: brew switch php version 
Php :: php base64 
Php :: pull information from another website 
Php :: delete image from public folder in laravel 
Php :: use app name in laravel blade 
Php :: php average from array 
Php :: background image in laravel blade 
Php :: php get user ip 
Php :: php set timezone italy 
Php :: php exec shell command 
Php :: 500 server error laravel 
Php :: php curl delete request 
Php :: uninstall php 8.0 ubuntu 
Php :: generate random number of 4 digit in php 
Php :: wordpress echo the excerpt 
Php :: wordpress https too many redirects 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =