evaristo g..daporta

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Multiple Recipients select from Directory #41746
    evaristo g..daporta
    Participant

    Hi. Just spend a few minutes trying to find out how to make this option work, but unfortunately, i didn’t find it on the settings area
    is the feature already added?

    thank you

    in reply to: Add custom filtering to DIRECTORY LISTING based on ACF Field #41521
    evaristo g..daporta
    Participant

    Nevermind, i figured it out:

    Solution:

    add_filter( 'fep_directory_arguments', function ($args){
                    $user = wp_get_current_user();
                    $role = $user->roles[0];
                    if( $role == 'delegate'){
                        $meta_query = array();
                        $comitee_post= get_field( 'comitee', 'user_'.$user->ID);
                        $meta_query  = array(
                            'relation' => 'AND',
                            array(
                                'key' => 'comitee',
                                'value' => $comitee_post->ID,
                                'compare' => '='
                            ),
                        );
    
                        $args['meta_query']	=   $meta_query;
                    }
                    return $args;
                }, 99);
    

    Hope it helps anyone!

Viewing 2 posts - 1 through 2 (of 2 total)