Delete admin edit/delete links in users list wordpress admin
Delete admin edit/delete links in users list wordpress admin
Delete admin edit/delete links in users list wordpress admin
How can restrict certain users from delete a category but can view only in wordpress?
You can club it with remove_menu_page to first remove the page & then re-adding it Copy the add_menu_page line from plugin. Paste it in your theme & change the capability. Then immediately before this line add remove_menu_page($menu_page_slug); Use the same hook but with a higher priority
$capa is a PHP expression and will always evaluate to administrator. Use the capability read instead – every role (by default) has this.
First of all you need to remove capability edit_others_posts if assigned to vendor role. Then use the code snippet given below: function posts_for_current_author($query) { global $pagenow; if( ‘edit.php’ != $pagenow || !$query->is_admin ) return $query; if( !current_user_can( ‘edit_others_posts’ ) ) { global $user_ID; $query->set(‘author’, $user_ID ); } return $query; } add_filter(‘pre_get_posts’, ‘posts_for_current_author’); Above code allows … Read more
It was a simple thing when thinking of it… I needed to add: $role->add_cap( ‘edit_others_pages ‘ );
As far as I know there’s no standard capabilities just for attachments. You’d need edit_posts. function add_theme_caps() { $role = get_role( ‘editor’ ); $role->add_cap( ‘edit_others_posts’ ); } add_action( ‘admin_init’, ‘add_theme_caps’);
Remove a top level admin menu: function custom_menu_page_removing() { remove_menu_page( $menu_slug ); } add_action( ‘admin_menu’, ‘custom_menu_page_removing’ ); To remove only certain menu items include only those you want to hide within the function. To remove menus for only certain users you may want to utilize current_user_can(). You can take a look at https://codex.wordpress.org/Function_Reference/remove_menu_page
You can take away users’ capabilities with a plugin like User Role Editor, or programmatically. What you’ll need to do is collect a list of all your post types that appear in the Editor (Core has Post and Page; plugins and themes may add more) and then remove properties with a plugin. For example, you … Read more
First, create [all-capabilities] shortcode. Put this code in your theme’s functions.php: function wpse_all_capabilities() { $out=”<style> .flex-columns { column-count: 4; column-gap: 3em; column-rule: 1px solid #000; } </style>”; $out .= ‘<p class=”flex-columns”>’; $users = get_users(); foreach ( $users as $user ) { if ( $user->caps[‘administrator’] ) { $allcaps = array_keys( $user->allcaps ); foreach ( $allcaps as … Read more