Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter

I got quite confused with Custom Post Type (CPT) ‘capability_type’ parameter and adding generated capabilities to a role. So I’ve got a CPT called ‘external_role’ registered as following: add_action(‘init’, ‘external_roles_post_type_init’); function external_roles_post_type_init() { $labels = array( ‘name’ => _x(‘External Roles’, ‘post type general name’), ‘singular_name’ => _x(‘external role’, ‘post type singular name’), ‘add_new’ => _x(‘Add … Read more

Temporarily give ‘manage_options’ capability

In order to allow editors to edit other’s author meta (update_user_attribute), I must give them the ‘manage_options’ capability or else I get a ‘Cheatin’ huh’ die message. I only want to give them this capability on one specific Edit Author Meta page. I give ‘editor’ permission to ‘list_users’ to access the Users admin table. I … Read more

Defining capabilities for custom post type

On creation of a custom post type I’m trying to define capabilities but it’s not working. What’s wrong with this code? $args = array( ‘labels’ => $labels, ‘public’ => true, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => true, ‘hierarchical’ => false, ‘menu_position’ => null, ‘supports’ => array(‘title’), ‘capabilities’ => array( ‘edit_post’ … Read more

Restrict Admin Capabilities in MultiSite

update_core update_plugins update_themes install_plugins install_themes delete_themes edit_plugins edit_themes Hi, I want to restrict those capabilities to user_id = Best Answero other super admins cant edit network files. (Btw if i am missing something, let me know). What is proper way of this? Tried http://wordpress.org/extend/plugins/extended-super-admins/ but it adds ‘manage_esa_options’ cap to every blog so super_admins see … Read more

How to 301 private posts rather than 404?

How do I 301 redirect private pages, rather than 404 them? If a post is private, WordPress filters it out in the SQL query, so there are no $post variables to work with. I’d like for this code to work, but doesn’t: add_action(‘wp’,’redirect_stuffs’, 0); function redirect_stuffs(){ global $post; if ( $post->post_status == “private” && !is_admin() … Read more

How to enable a site administrator to edit users in a WordPress network/ multisite setup?

I have a few sites in a network. I don’t want the site administrators to manage things like network plugins, but I would like them to be able to edit profiles of all network users, not use those on their site. At the top of the /wp-admin/network/users.php file is this: if ( ! current_user_can( ‘manage_network_users’ … Read more