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 :: how to echo only certain character number in php 
Php :: php remove all whitespace from a string 
Php :: how to play sound with php 
Php :: laravel foreach 
Php :: laravel force delete 
Php :: php select option 
Php :: str_contains 
Php :: symfony doctrine existing database 
Php :: menampilkan hari dan tanggal sekarang di php 
Php :: change password function in laravel 
Php :: php if $_post 
Php :: laravel delete 
Php :: php import script 
Php :: retrieving a cookie in php 
Php :: curl in php 
Php :: what is scalar data type in php 
Php :: compare two arrays and return the difference php 
Php :: get all laravel validation failed messages 
Php :: change key value laravel map collection 
Php :: php remove html tag 
Php :: laravel get single column value 
Php :: php check for null 
Php :: wp_create_user 
Php :: PHP Forms - Required Fields 
Php :: onclick call route laravel 
Php :: php login google api 
Php :: php alert yes no 
Php :: upload_max_filesize in wordpress 
Php :: how to get just the first row from a table in laravel 
Php :: limited text show in laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =