Use the `MONTH_IN_SECONDS` constant added in [33698] for the month representation in `human_time_diff()` logic.
Props tyxla. Fixes #34602. Built from https://develop.svn.wordpress.org/trunk@35555 git-svn-id: http://core.svn.wordpress.org/trunk@35519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ad65267b6
commit
5f16d19be7
|
@ -2844,13 +2844,13 @@ function human_time_diff( $from, $to = '' ) {
|
|||
if ( $days <= 1 )
|
||||
$days = 1;
|
||||
$since = sprintf( _n( '%s day', '%s days', $days ), $days );
|
||||
} elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
|
||||
} elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
|
||||
$weeks = round( $diff / WEEK_IN_SECONDS );
|
||||
if ( $weeks <= 1 )
|
||||
$weeks = 1;
|
||||
$since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
|
||||
} elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
|
||||
$months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
|
||||
} elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
|
||||
$months = round( $diff / MONTH_IN_SECONDS );
|
||||
if ( $months <= 1 )
|
||||
$months = 1;
|
||||
$since = sprintf( _n( '%s month', '%s months', $months ), $months );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-beta3-35554';
|
||||
$wp_version = '4.4-beta3-35555';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue