Last active
July 17, 2019 18:46
-
-
Save marktenney/e2fb91cf033791507f31e78ea7cba16d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dgtl_filter_hidden_groups( $query_args ) { | |
if ( 'um_groups' == $query_args['settings']->post_type ) { // if the post type selected is 'um_groups' | |
$query_args['meta_key'] = '_um_groups_privacy'; // and custom field '_um_groups_privacy' | |
$query_args['meta_value'] = 'hidden'; // and field value 'hidden' | |
$query_args['meta_compare'] = '!='; // are not equal | |
} | |
return $query_args; // only show public & private groups | |
} | |
add_filter( 'fl_builder_loop_query_args', 'dgtl_filter_hidden_groups' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment