weedor
1
I created a Query for products.
Here is the code:

There are 2 products in the database according to these rules.
Yet the query returns 3 items:
- the 2 products
- 1 page without any category
I didn’t published in bug, because I am not sure not to have done something wrong, but I am a bit suspicious…
weedor
2
If anybody else is looking for these query filters, here are the shortcoddes:
add_shortcode( 'expired-date', function (){
global $post;
date_default_timezone_set("Europe/Paris");
$tod = date('Y-m-d H:i:s');
date_default_timezone_set("UTC");
$eve = date('Y-m-d H:i:s', strtotime(str_replace('/', '-', get_field( 'event_date', $post->ID ))));
$ret = ( $tod >= $eve );
return "$ret";
});
add_shortcode( 'is_publish', function (){
global $post;
$ret = ( get_post_status ( $ID ) == 'publish' );
return "$ret";
});