Removing Admin Bar Node Based on Role

WP_User has a roles array. Get the current user with wp_get_current_user() and check if your role is in the array. add_action( ‘admin_bar_menu’, ‘remove_new_content_menu’, PHP_INT_MAX ); function remove_new_content_menu( $wp_admin_bar ) { // get the current user $user = wp_get_current_user(); // define roles that cannot see the `new content` button $blacklisted_roles = array(‘grocery’, ‘subscriber’); // remove the … Read more

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