Last active
November 8, 2019 22:11
-
-
Save marktenney/8fe223d9337d74cc3894eb9adc3559b6 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
<?php | |
function fl_builder_events_loop_query_args_filter( $query_args ) { | |
$campus = rwmb_meta('campus') // Get the Campus of the page you are on from metabox value | |
if ( 'campus-events' == $query_args['settings']->id ) { // If the posts module has the ID 'campus-events' | |
$query_args['taxonomy'] = $campus; // Filter by events that also have the term of the same campus | |
} | |
return $query_args; | |
} | |
add_filter( 'fl_builder_loop_query_args', 'fl_builder_events_loop_query_args_filter' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment