Skip to content

Instantly share code, notes, and snippets.

@MjHead
Created November 26, 2021 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MjHead/ce5c649bbe725a49ecd6f623d49a1a2f to your computer and use it in GitHub Desktop.
Save MjHead/ce5c649bbe725a49ecd6f623d49a1a2f to your computer and use it in GitHub Desktop.
Add own parameters into JetEngine Listing query args
<?php
add_filter( 'jet-engine/listing/grid/posts-query-args', function( $args, $widget, $settings ) {
if ( 'custom-query' === $settings['_css_classes'] ) {
$args['meta_query'][] = array(
'relation' => 'OR',
0 => array(
'key' => 'submission-date',
'value' => strtotime( 'Today' ),
'compare' => '>=',
'type' => 'NUMERIC'
),
1 => array(
'key' => 'submission-date',
'value' => '',
'compare' => '=',
),
);
}
return $args;
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment