Skip to content

Instantly share code, notes, and snippets.

@marktenney
Last active July 17, 2019 18:46
Show Gist options
  • Save marktenney/e2fb91cf033791507f31e78ea7cba16d to your computer and use it in GitHub Desktop.
Save marktenney/e2fb91cf033791507f31e78ea7cba16d to your computer and use it in GitHub Desktop.
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