Reply To: Hide Roles in Front End PM Pro Directory


Home Forums Front End PM PRO Hide Roles in Front End PM Pro Directory Reply To: Hide Roles in Front End PM Pro Directory

#21199
Rasaki Onile-Ere
Participant

Hi,

I think I have made an error; but I added the following code and I got the ‘white screen of death’.

Please help me amend it.

add_filter( 'fep_directory_arguments', function( $args ){
$role_users_to_hide = array( 'subscriber', 'author',Admin', Customer', Event Contributor', Employee', Contributor', HR Manager', Shop Manager', Accounting Manager', Editor'); //here add as many as you want
if ( isset( $args['role__not_in'] ) ) {
$args['role__not_in'] = array_merge( $args['role__not_in'], $role_users_to_hide );
} else {
$args['role__not_in'] = $role_users_to_hide;
}
return $args;
}, 99);