From 5f16d19be750504b990d443a67839230afd790e2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 6 Nov 2015 16:34:26 +0000 Subject: [PATCH] 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 --- wp-includes/formatting.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 3208abec92..da46d3d49f 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index f88d96fff5..776ccd760e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.