Custom wordpress admin page/url “You do not have sufficient permissions to access this page.”

This is what you need: function my_special_function(){ ?> <div class=”wrap”> <h2>Hello World</h2> <!– ALL THE CUSTOM MARK UP SHOULD BE INSIDE WRAP–> </div> <?php } function my_menu_page(){ add_menu_page(‘Page title’, ‘Menu Title’, ‘administrator’, ‘page_slug’, ‘my_special_function’); } add_action(‘admin_menu’, ‘my_menu_page’); Try this!

Custom Capabilities for CPT and Problem with current_user_can()

Solved! Meta Capabilities edit_product, delete_product, ‘read_product` etc should be handled separately. Below code is from Justin Tadlocks Site add_filter( ‘map_meta_cap’, ‘fac_map_meta_cap’, 10, 4 ); function fac_map_meta_cap( $caps, $cap, $user_id, $args ) { /* If editing, deleting, or reading a product, get the post and post type object. */ if ( ‘edit_product’ == $cap || ‘delete_product’ … Read more

Administrator role capabilities

you’re creating a function and just initializing a local scope variable that you overwrite it. here is a different approach: global $wp_roles; // global class wp-includes/capabilities.php $wp_roles->remove_cap( ‘administrator’, ‘manage_options’ ); _based on codex:remove_cap_ Edit: /** * Remove capability from admins. */ function wpcodex_set_capabilities() { // Get the role object. $admin = get_role( ‘administrator’ ); $admin->remove_cap( … Read more

Assign multiple roles , overlapping capabilities

I am pretty sure that nothing would happen other than the user would have the capability in question. Think about it. The default Roles share many capabilities— Authors, Editors, and Administrators all have edit_posts, for example. All roles (usually) have read The same system manages both default and custom roles/capabilities, so there really should be … Read more

Capabilities Not Changing

I believe your code is right. Try going to: ‘wp-admin/users.php’ manually to check if you have the privilege to do so. If my inkling is right, it’s just the $submenu item that is hidden. If you can access the list of users, try printing the global variable $submenu and see if ‘users.php’ is there.