#54514
wpraider
Participant

Found it in the source code.

You can just add a views_query to the wp_query args, like:

// required by PVC
‘suppress_filters’ => false,
‘orderby’ => ‘post_views’,
‘fields’ => ”,
‘views_query’ => array(
‘year’ => date(‘Y’)
)

the views_query options are:
‘views_query’ => array(
‘year’ => ”,
‘month’ => ”,
‘week’ => ”,
‘day’ => ”,
‘after’ => ”, // can be string or array
‘before’ => ”, // can be string or array
}