Home › Forums › Front End PM PRO › Hide Roles in Front End PM Pro Directory
- This topic has 13 replies, 2 voices, and was last updated 6 years, 9 months ago by Shamim Hasan.
- 
		AuthorPosts
- 
		
			
				
January 31, 2019 at 3:01 am #21167Rasaki Onile-EreParticipantI would like to have the ability to hide specific roles from the Front End Directory. I want the ability to be able to add to the list of hidden roles. However, to start with, please hide all roles except the role ‘Member’ from the Front End PM Pro User Directory. Thank you. January 31, 2019 at 3:18 am #21170Shamim HasanKeymasterAdd following code in your theme’s (child theme’s if you are using) functions.php add_filter( 'fep_directory_arguments', function( $args ){ $role_users_to_hide = array( 'subscriber', 'author' ); //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);change/add as many roles slug as you want in place of subscriber, author February 1, 2019 at 5:40 pm #21199Rasaki Onile-EreParticipantHi, 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);February 1, 2019 at 6:41 pm #21202Shamim HasanKeymasterYou need to find role slug to use here. 
 eg. Slug of Subscriber is subscriber (lower cased). So you need to find slug of your all roles. Also use quote in both side. Eg'subscriber'February 1, 2019 at 10:30 pm #21209Rasaki Onile-EreParticipantHi, Thanks for the prompt response. Where do we locate the slug from? Thanks, Rasaki February 1, 2019 at 10:55 pm #21212Rasaki Onile-EreParticipantThis reply has been marked as private.February 2, 2019 at 2:17 am #21215Shamim HasanKeymasterYour code seems ok. 
 Where you are adding this code?
 Please see your server error log to see what error it shows there.February 2, 2019 at 8:43 pm #21243Rasaki Onile-EreParticipantThis reply has been marked as private.February 3, 2019 at 12:32 am #21249Shamim HasanKeymasterMake sure you have added after <?phptag. if still not work please enable debug (https://codex.wordpress.org/Debugging_in_WordPress) to see actual error message.Let me know. February 3, 2019 at 8:38 pm #21269Rasaki Onile-EreParticipantThis reply has been marked as private.February 4, 2019 at 12:40 am #21272Shamim HasanKeymasterWe cannot correct code blindly. Please enable debug (add define( 'WP_DEBUG', true );in wp-config.php) to get actual error message.If you want you can send me your FTP and wordpress admin credentials using https://www.shamimsplugins.com/sensitive-information/ so that i can assist you to add this code in your website. February 5, 2019 at 4:43 pm #21342Rasaki Onile-EreParticipantThis reply has been marked as private.February 5, 2019 at 7:00 pm #21345Shamim HasanKeymasterThis is not the plugin issue. This is issue with the custom code added later. 
 Screen share support is not possible. You can give your website credentials or the functions.php file where you added this code so that i can check if you added in right place or not.As you are getting white screen of death it must be some error message. May be you have enable debug in wrong place. February 5, 2019 at 7:05 pm #21347Shamim HasanKeymasterOr you can live chat with me. 
 Please go to https://www.shamimsplugins.com/live-chat/ and see chat option in bottom right.
 This live chat option will be available for next 30 minutes.
- 
		AuthorPosts
You need to purchase ‘Front End PM PRO’ to create topic in this support forum.
If you already purchased ‘Front End PM PRO’ please LOGIN.