function get_count_day_post( $date) {
$timestamp = strtotime($date);
$day = getdate($timestamp);
$args = array(
'date_query' => array(
array(
'year' => $day['year'],
'month' => $day['mon'],
'day' => $day['mday'],
),
),
);
$query = new WP_Query( $args );
return count( $query );
}
echo 'количество постов за дату переданную в функцию (1 февраля 2015) - ' . get_count_day_post( '01-02-2015');
IMPORTANT: This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. If there are functions hooked to this filter, they will always run. This could lead to a performance problem.