Reply To: new announcement to roles filter


Home Forums Front End PM PRO new announcement to roles filter Reply To: new announcement to roles filter

#19334
shamim
Keymaster

add following code in your theme’s (child theme’s if using) functions.php

add_filter( 'fep_filter_to_roles_to_create_announcement', function( $roles ) {
	$access_roles = fep_get_option( 'userrole_access', array() );
	
	$wp_roles = wp_roles()->roles;
	$roles = array();
	foreach( $wp_roles as $role => $role_info ){
		if ( in_array( $role, $access_roles ) ) {
			$roles[ $role ] = translate_user_role( $role_info['name'] );
		}
	}
	
	return $roles;
});