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 = 1 so 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

Including only current user’s posts in search

I am a new WP plugin developer. I want the search page to include only the current user’s posts. I first added a new capability read_others_posts to only administrators and editors. Then I tried the following code, placing it in a function and hooking it to the pre_get_posts action: if( !current_user_can(‘read_others_posts’) ) $query->set( ‘author’, get_current_user_id() … Read more

Add custom capabilities to existing custom post type

The only way I can find to associate post types with custom capabilities is during the register_post_type function. I’m looking to add a capability for a certain role (my_role) for a post type that already exists (my_post_type). I’m looking to allow front-end users to view my_post_types only as well as create them using a form … Read more

How to allow Unfiltered HTML in a wordpress multisite install

I am trying to create a custom role in a wordpress multisite environment. This role is to have the same capabilities as an admin but also have the ability to commit unfiltered HTML like super admins. I have had success in creating the role and set unfiltered_html to true, but the text editor still strips … Read more

Custom Role for CPT Only

I have removed admin specific capabilities for the custom role however they can still delete admin published listings. I only want people with the custom role of submit_listing to be able to submit and edit own listings, not delete or edit listings from admin, author or editor. add_action( ‘admin_init’, ‘add_custom_role_capabilities’, 999 ); function add_custom_role_capabilities() { … Read more

Notice: Undefined property: stdClass::$delete_posts with custom post type

I created a custom post type called gdpr_qao and I set ‘capability_type’ => array( ‘gdpr_qao’, ‘gdpr_qsaos’ ) in register_post_type arguments. On main custom post type screen I get: Notice: Undefined property: stdClass::$delete_posts in /srv/www/wp-plugins/public_html/wp-admin/includes/class-wp-posts-list-table.php on line 411 and in bulk actions there isn’t delete option. How can I solve this problem? Here the custom post … Read more