evaristo g..daporta
Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- evaristo g..daportaParticipant
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
October 25, 2020 at 6:12 pm in reply to: Add custom filtering to DIRECTORY LISTING based on ACF Field #41521evaristo g..daportaParticipantNevermind, 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!
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)