Create Super Admin that cant be deleted

There are 2 approaches to get something equivalent to what you want, but, it isn’t possible to have exactly what you want. On a single site administrator is the highest level, so you can’t have higher than the highest. Instead, here are alternatives: Turn your site into a multisite install that contains only 1 site, … Read more

Prevent Editors from Editing/Deleting Admin Accounts

There is a function WordPress uses called get_editable_roles, which is (I think) used to determine which roles a particular user can edit. The source for this function looks like this: function get_editable_roles() { global $wp_roles; $all_roles = $wp_roles->roles; $editable_roles = apply_filters(‘editable_roles’, $all_roles); return $editable_roles; } So, it looks like you may be able hook into … Read more

Contributor disable seeing others’ posts

I hope you are talking about wp-admin section. If yes just place this code in your functions.php file add_action( ‘load-edit.php’, ‘posts_for_current_contributor’ ); function posts_for_current_contributor() { global $user_ID; if ( current_user_can( ‘contributor’ ) ) { if ( ! isset( $_GET[‘author’] ) ) { wp_redirect( add_query_arg( ‘author’, $user_ID ) ); exit; } } }

How to redirect specific post type with user role

add_action(‘load-index.php’, ‘redirect_dashboard’); function redirect_dashboard() { if ( ! is_admin() || current_user_can(‘activate_plugins’) ) return; $screen = get_current_screen(); if ( is_object($screen) && $screen->base == ‘dashboard’ ) { $url = admin_url(‘edit.php’); wp_safe_redirect( add_query_arg( array(‘post_type’ => ‘product’), $url) ); die(); } }

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

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