Search
 
SCRIPT & CODE EXAMPLE
 

PHP

from user id to user role wordpress

$user_meta = get_userdata( $user_id );

$user_roles = $user_meta->roles; // array with all the roles the user is part of.
Comment

update user role wordpress

$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('editor');
Comment

PREVIOUS NEXT
Code Example
Php :: get where different laravel 
Php :: Unable to create PsySH runtime directory. Make sure PHP is able to write to /run/user in order to continue. 
Php :: php select option selected from database 
Php :: php if negative make positive 
Php :: web scraping in php 
Php :: remove element from xml on php 
Php :: laravel nested query builder 
Php :: php generating number 
Php :: How to get route parameter in blade? 
Php :: email configuration for gmail in laravel 
Php :: wpdb get results foreach 
Php :: laravel migration table column nullable 
Php :: Allowed memory size of 1610612736 bytes exhausted 4096 
Php :: laravel project create with version 
Php :: laravel artisan call with confirm 
Php :: illuminate/container requires php your php version (X.X.XX) does not satisfy that requirement. 
Php :: emergency password reset script wordpress 
Php :: laravel query with trashed 
Php :: laravel spatie asigne role 
Php :: set cookie one day php 
Php :: layout.blade.php in laravel 
Php :: file upload in php mysql 
Php :: how to change php version in cpanel 
Php :: echo php 
Php :: Array to XML Conversion using PHP 
Php :: laravel migration update table column type 
Php :: php foreach alternative syntax 
Php :: clear cache in symfony 
Php :: how to display the site tagline in wordpress 
Php :: call php function in js 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =