wpseek.com
A WordPress-centric search engine for devs and theme authors
_wp_dashboard_on_this_day_date_query_clause is private and should not be used in themes or plugins directly.
_wp_dashboard_on_this_day_date_query_clause › WordPress Function
Since7.1.0
Deprecatedn/a
› _wp_dashboard_on_this_day_date_query_clause ( $date )
| Access: |
|
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
| Codex: |
Builds the date query clause for today's anniversary date.
On February 28 in a non-leap year, February 29 posts are included so leap-day anniversaries still appear.Source
function _wp_dashboard_on_this_day_date_query_clause( $date ) {
$month = (int) $date->format( 'm' );
$day = (int) $date->format( 'd' );
$clause = array(
'month' => $month,
'day' => $day,
);
// Display leap day posts on Feb 28 in non leap years.
if (
28 === $day
&& 2 === $month
&& false === (bool) $date->format( 'L' )
) {
$clause = array(
'relation' => 'OR',
$clause,
array(
'month' => 2,
'day' => 29,
),
);
}
return $clause;
}