mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Date/Time: In wp_maybe_decline_date(), add support for a range of days, e.g. February 21–23.
A potential use case is displaying multi-day events in the WordPress Events and News dashboard widget. See #47798, #48934. git-svn-id: https://develop.svn.wordpress.org/trunk@47098 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -373,11 +373,11 @@ function wp_maybe_decline_date( $date, $format = '' ) {
|
||||
|
||||
if ( $decline ) {
|
||||
foreach ( $months as $key => $month ) {
|
||||
$months[ $key ] = '#\b' . preg_quote( $month, '#' ) . ' (\d{1,2})(st|nd|rd|th)?\b#u';
|
||||
$months[ $key ] = '#\b' . preg_quote( $month, '#' ) . ' (\d{1,2})(st|nd|rd|th)?([-–]\d{1,2})?(st|nd|rd|th)?\b#u';
|
||||
}
|
||||
|
||||
foreach ( $months_genitive as $key => $month ) {
|
||||
$months_genitive[ $key ] = '$1 ' . $month;
|
||||
$months_genitive[ $key ] = '$1$3 ' . $month;
|
||||
}
|
||||
|
||||
$date = preg_replace( $months, $months_genitive, $date );
|
||||
|
||||
Reference in New Issue
Block a user