wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_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
Seit7.1.0
Veraltetn/v
› _wp_dashboard_on_this_day_date_query_clause ( $date )
| Zugriff: |
|
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
| 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.Quellcode
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;
}