Remove Marketing Menu link based on the username
-
This code doesnt work and it just hiding the menu link
function my_remove_menu_pages() { remove_menu_page( 'wc-admin&path=/marketing' ); }
SO, i want to do this with a filter. i wrote this code. what’s the issue with this code? it doesnt work
add_filter( 'woocommerce_admin_features', function( $features ) { return array_values( array_filter( $features, function($feature) { $user = wp_get_current_user(); if($user && isset($user->user_login) && 'Reception' == $user->user_login) { return $feature !== 'marketing'; } } ) ); } );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Remove Marketing Menu link based on the username’ is closed to new replies.