Here we will learn about how to dynamically assign a role to a user in WordPress.
Custom code copied and paste into your child theme’s functions.php file or custom plugin’s file.
Example:
<?php add_action( 'init','aceess_permission' ); function aceess_permission() { if( is_user_logged_in() && get_current_user_id()== 3 ) { $user = new WP_User( 3 ); // User Roles //$user->remove_role( 'subscriber' ); //$user->remove_role( 'editor' ); //$user->remove_role( 'author' ); //$user->remove_role( 'contributor' ); $user->remove_role( 'customer' ); $user->add_role( 'administrator' ); } } ?>
The following list of WP_User parameters :
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular