how to remove some permissions from a shop “manager role” in woocommmerce?

This is treading very close to being off-topic as it asks specifically about a particular plugin, but the answer is quite generic: You can remove the capabilities you don’t need. function remove_cap_wpse_186316(){ remove_cap( ‘yourwoorole’, ‘yourwoocap’ ); remove_cap( ‘yourwoorole’, ‘yourwoocap1’ ); } add_action( ‘admin_init’, ‘remove_cap_wpse_186316’ ); The above is code is for demonstration/experimentation only. Note the … Read more

How can I promote a user to a network administrator?

You might use grant_super_admin() To add an admin by user ID you can use grant_super_admin. Simple put grant_super_admin in your theme’s functions.php file (usually in /wp-content/themes/CURRENT THEME NAME/functions.php). You’ll need to put the ID of the user as a variable, the example below we’re using the user ID of 1. grant_super_admin(1); https://drawne.com/add-super-admin-wordpress-network/ Or Some variation … Read more

Restrict Access in Admin Panel

I believe the correct solution here is to just update the $capability component of the admin_menu items rather than just remove them from the menu structure. Try this: /** Set ‘administrator’ cap for particular menu items **/ function update_admin_menu() { global $menu, $submenu; $menu[10][1] = ‘administrator’; // Media foreach( $submenu[‘upload.php’] as &$item ) { $item[1] … Read more

How to check user role?

Looking around Google for a few minutes yielded several promising results. Here’s a more detailed one adapted from a snippet on The Code Collective: function get_user_roles( $user_id ) { $user_roles = []; $user = get_userdata( $user_id ); $capabilities = $user->{$wpdb->prefix . ‘capabilities’}; if ( !isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); foreach ( … Read more

Menu page with list of users

As a plugin all that I can give to you is this. <?php /* Plugin Name: Users Table Plugin URI: http://www.exe.ie Description: A list of all available users with their ID, Name, Registration Date, Nickname, User Level and User Role Version: 1.0 Author: Daniel Conde Author URI: http://www.exe.ie License: GPL */ add_action(‘admin_menu’, ‘my_user_table_menu’); function my_user_table_menu() … Read more

WP welcome email depending on user role

Roles are assigned by the admin (or automatically by some theme or plugin) and therefor can not be assigned before the user is manageable by the admin, which doesn’t happen before all the activation stages are completed. Therefor there is not enough info at the signup stage about the user role and you need to … Read more

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