PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

How can we use date_query?

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

WOOF has a filter woof_get_meta_query to modify the meta_query but is there any filter to use date_query?

Or any other method to get products in a date range?

Hello

Use somting like  this

add_filter('posts_where', function( $where = '' )  {

//set your value
$value_to ='';
$value_from ='';

$where .=" AND post_date <= '{$value_to}' AND post_date >= '{$value_from}'";

return $where;
}, 101);

Hi Pablo,

It's working great!

Many thanks for your help.

Hello

Welcome;)