Restrict the shop_manager role to the WooCommerce Orders Page

I finally found the solution. function checkUserPermissionsInThisScreen(){ if (is_admin()){ $currentUserRoles = wp_get_current_user()->roles; if (in_array(‘shop_manager’, $currentUserRoles)){ $a = get_current_screen(); if ($a->id != ‘edit-shop_order’ && $a->post_type != ‘shop_order’){ wp_die(‘you do not have needed permissions to see this page’); } } } } add_action(‘current_screen’, ‘checkUserPermissionsInThisScreen’);

I want this code to work only for Authors AND Contributors

Here you go, and remember, this assumes that your function was already working (I did not check that it was), and if it was, then just wrap like this: <?php add_action( ‘admin_menu’, ‘wf_cli_remove_admin_menu’ ); function wf_cli_remove_admin_menu() { $wf_user = wp_get_current_user(); $wf_roles = array( ‘contributor’, ‘author’ ); if( array_intersect( $wf_roles, $wf_user->roles ) ) : remove_menu_page( ‘index.php’ … Read more

Zigconnect Plugin: Allowing editors to remove connections

You could give the user the capability manage_options, however this will allow them to edit all options within wordpress. The best bet will be to change all the capabilites checks from manage_options to level_7 or some other editor capability(like edit_others_posts ) within the plugin. (Found 12 matches, 7 on zigconnect\zigconnect.php and 5 on zigconnect\zigconnect-admincallbacks.php )

WordPress Role Capability Restriction

The following excludes posts not written by the user from the edit-post screen (you can add further screen IDs if necessary) if they have the ‘contributor’ role. Normally I would suggest adding a custom capability, and comparing the capability not the role. But since it seems this plug-in isn’t for distribution, this is isn’t such … Read more

Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?

Yes this is possible. Add the following to either your plugin code or the theme’s functions.php file: function mypo_parse_query_useronly( $wp_query ) { if ( strpos( $_SERVER[ ‘REQUEST_URI’ ], ‘/wp-admin/edit.php’ ) !== false ) { if ( !current_user_can( ‘update_core’ ) ) { global $current_user; $wp_query->set( ‘author’, $current_user->id ); } } } add_filter(‘parse_query’, ‘mypo_parse_query_useronly’ ); Reference original … Read more

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