Answers for "php wordpress user roles"

PHP
0

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.
Posted by: Guest on October-14-2020
0

wordpress get wp roles

function get_role_names() {

global $wp_roles;

if ( ! isset( $wp_roles ) )
    $wp_roles = new WP_Roles();

return $wp_roles->get_names();
}
Posted by: Guest on April-01-2021

Browse Popular Code Answers by Language