Reply To: Need to hide or disable the buttons for settings and announcements


Home Forums Front End PM PRO Need to hide or disable the buttons for settings and announcements Reply To: Need to hide or disable the buttons for settings and announcements

#27181
shamim
Keymaster

You can use following code instead

add_filter( 'fep_menu_buttons', function( $menu  ){
    if ( array_intersect( [ 'external-user-student', 'external-user-teacher' ], wp_get_current_user()->roles ) ){
        unset( $menu['settings'], $menu['announcements']  );
    }
    return $menu;
}, 99);