• Resolved viktord

    (@viktord)


    Thanks for a great plugin and for great support. Love this plugin!
    Is there a way to filter directory list of a subscriber role by a specific user meta key, for example: user_group. If during registration, user selects group 1, they will only be able see group 1 users in the directory list. Same with group 2 and on…

    Thanks again.

Viewing 1 replies (of 1 total)
  • Plugin Author Shamim Hasan

    (@shamim51)

    You can use meta query.
    Add following code in your theme’s ( child theme’s if any) functions.php

    add_filter('fep_directory_arguments', function( $args ){
        $args['meta_query'] = array(
            'key' => 'user_group',
            'value' => get_user_meta( get_current_user_id(), 'user_group', true ),
        );
    
        return $args;
    });
    
Viewing 1 replies (of 1 total)

The topic ‘Filter Directory List’ is closed to new replies.