Create custom role, multisite, add users/sites?

According to the Codes on capabilities the manage_sites and manage_network_users should grant these options, or am I not reading correctly? Apparently, the capabilities here are not enough. Check out wp-admin/network.php. You’ll see it dies if the current user fails the is_super_admin check. This check gets the $super_admins global from get_super_admins and returns false if the … Read more

Getting user roles in plugin files

Figured my comment would actually make a better answer, so here we go. You can hook other methods within the plugin class onto admin_init (for the admin side) within the constructor, like so: class Plugin_Class { public function __construct() { add_action( ‘admin_init’, array( $this, ‘some_other_method’ ) ); } public function some_other_method() { // do something … Read more

get approved users only ( ultimate member plugin )

I assume your WP settings is New User Default Role = contributor If yes, so this block of code shows all the contributor’s with account_status = approved; $args = array( ‘role’ => ‘contributor’, ‘meta_key’ => ‘account_status’, ‘meta_value’ => ‘approved’ ); $users = get_users($args); foreach ($users as $user) { echo ‘<pre>’; print_r( $user ); echo ‘</pre>’; … Read more

Plugin to restrict access to pages in wp-admin

if( is_admin() ) { add_filter( ‘init’, ‘custom_restrict_pages_from_admin’ ); } function custom_restrict_pages_from_admin() { global $pagenow; $arr = array( ‘update-core.php’, ‘edit.php’ ); if( custom_check_user_roles() && in_array( $pagenow , $arr ) ) { //echo some custom messages or call the functions } else { echo ‘This page has restricted access to specific roles’; wp_die(); } } function custom_check_user_roles() … Read more

Are there individual memory allocations for different user roles in WordPress?

Because of this line in wp-admin/admin.php: if ( current_user_can( ‘manage_options’ ) ) { wp_raise_memory_limit( ‘admin’ ); } In other words, WordPress raises the memory limit to WP_MAX_MEMORY_LIMIT within the admin, but only for users with the manage_options capability i.e. administrators. Your best bet is to raise the default memory limit in your wp-config.php: define( ‘WP_MEMORY_LIMIT’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)