Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Add a Post Module, got to Advanced Tab and set the ID to 'example-module'.
- // Or to whatever you will use in the callback below
- //
- // It assumes that on the post type and posts there is a field called 'my_until_field',
- // which will be used to further filter the query results
- function fl_builder_loop_query_args_filter( $query_args ) {
- if ( 'example-module' == $query_args['settings']->id ) {
- $query_args['meta_query'] = array(
- 'relation' => 'AND',
- 'my_until_field_clause' => array(
- 'key' => 'my_until_field',
- 'value' => date( 'Ymd' ),
- 'compare' => '>=',
- 'type' => 'DATE',
- )
- );
- }
- return $query_args;
- }
- add_filter( 'fl_builder_loop_query_args', 'fl_builder_loop_query_args_filter' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement