What are the differences in capabilities between the super-administrator and administrator?

The super_admin has access to all admininstrator APIs and also the multi-site functions. If you go to the codex page, it will say so: http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table You can find the multisite functions here: http://codex.wordpress.org/Function_Reference#Multisite_functions If you want to do a more fine-grain investigation of what it can call, I suggest you get familiar with the WP … Read more

How to restrict specific post types from being read or added by specific user roles (eg. author)?

For the solution to your question, In the register_post_type arguments, use the capability_type parameter & then grant the specific capabilities to the users. For instance, if you set ‘capability_type’ => ‘supplier’, grant the edit_supplier capability to all administrators only More Details capabilities takes an array of the capabilities in the format ‘edit_post’ => ‘edit_supplier’ This … Read more

Can’t use /wp-json/wp/v2/plugins API endpoint even as administrator

SUGGESTIONS I suggest the following: first ensure you are running WordPress version 5.5.* as this version adds the endpoints for /wp/v2/plugins see: New and modified REST API endpoints in WordPress 5.5 using basic authentication issue a request as per the following using curl curl –user username:password https://example.com/wp-json The first request should succeed regardless because it … Read more

Shold I manually add ‘cap’ to admin role ?

A new capability has to be explicitly added to either a role or a user. In your case if you want all administrators to have ‘cap’ capability you will add it to ‘administrator’ role: $role = get_role( ‘administrator’ ); $role->add_cap( ‘cap’ ); If you want a specific administrator only to have ‘cap’ capability then you … Read more

How-to Delay The Capability To Publish Posts?

There won’t be a plugin for that, so I wrote one. You can use it as plugin or (better) a mu-plugin (place it in your ~/wp-content/mu-plugins folder). Mu-Plugin: delay the possibility to “publish a post” by removing the MetaBox For a detailed explanation of what happens and why it happens, please refer to the inline … Read more

Email notification for editors only

Use get_users() function. Reference function notify_editors( $post_id ) { $post = get_post( $post_id ); // Get all editors $editors = get_users( [ ‘role__in’ => [ ‘editor’] ] ); foreach ( $editors as $editor ) { // Setup email $subject = “Post Published: ” . $post->post_title; $message=” Hi ” . $editor->display_name . ‘, Your post, “‘ … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)