new announcement to roles filter


Home Forums Front End PM PRO new announcement to roles filter

This topic is: Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19101
    arancia-ict
    Participant

    When I do a new announcement, in the “To roles:” field I see all WordPress roles. Instead I would like to see only those roles that can access the FEP system. I mean the roles I set in the Security Settings option “Who can access message system?”.
    Thanks

    #19202
    arancia-ict
    Participant

    Hi, any news about my question?
    This is a high priority issue for my installation.
    Thanks

    #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;
    });
    
    #19439
    arancia-ict
    Participant
    This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 total)

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.