remove other tabs in new wordpress media gallery

If you want to hide the Media Library submenu: you can do it via the admin_menu action: function wpse85351_hide_submenus() { if(!current_user_can(‘edit_posts’)){ global $submenu; unset($submenu[‘upload.php’][5]); // hide the Media Library } } add_action(‘admin_menu’, ‘wpse85351_hide_submenus’); If you want to change/remove the Media strings: you can use the media_view_strings filter: function wpse85351_media_strings($strings) { // only for subscribers: if(!current_user_can(‘edit_posts’)){ … Read more

Hooking into add_submenu_page

Hook into admin_head, the last action before the menu is rendered, and change the global $menu: add_action( ‘admin_head’, ‘wpse_71303_change_menu_cap’ ); /** * Change the capability to access an admin menu item. * * @wp-hook admin_head * @return void */ function wpse_71303_change_menu_cap() { global $menu; foreach ( $menu as $key => $item ) { // Find … Read more

When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?

It does not automatically create that capability in the sense that there is no new capability registered with WordPress. Instead it defaults to use the capabilities assigned to creating/editing posts. For example, if an author logs in they will be able to create and publish a new destination entry by default. You can override this … Read more

Listing all capabilities in dropdown is returning boolean

Solved with this Answer at Stack Overflow. Each Array Key was the actual name of the capability […] You were searching for the capabilities by name, and since you were only seeing 1s in the output, I figured what you were looking for was in the keys. foreach($capslist as $cap=>$caps){ $dropdown .= ‘<option value=”‘.$cap.'”>’.$cap.'</option>’; }

Allow user to Publish, but not Edit or Delete

I am not sure what you’re trying to do by not allowing Edit. Its only a job of Publishing the post it seems. (or maybe add some Meta description etc) But, if you’re looking at creating a Moderator, you need to create additional user group & assign permissions. You can try http://wordpress.org/plugins/advanced-access-manager/ or similar plugins … Read more