From 1e7b12978c78ce6d2ced19c00898d577474eacd7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 29 Jun 2014 18:10:52 +0000 Subject: [PATCH] Set date format before going into the loop to avoid a PHP notice if 'lastupdated' column is filtered out. props jeremyfelt. fixes #27614. git-svn-id: https://develop.svn.wordpress.org/trunk@28898 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-ms-sites-list-table.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php index 43652e68a6..7e98b0f9eb 100644 --- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -187,6 +187,12 @@ class WP_MS_Sites_List_Table extends WP_List_Table { 'mature' => array( 'site-mature', __( 'Mature' ) ) ); + if ( 'list' == $mode ) { + $date = 'Y/m/d'; + } else { + $date = 'Y/m/d \<\b\r \/\> g:i:s a'; + } + $class = ''; foreach ( $this->items as $blog ) { $class = ( 'alternate' == $class ) ? '' : 'alternate'; @@ -307,10 +313,6 @@ class WP_MS_Sites_List_Table extends WP_List_Table { case 'lastupdated': echo ""; - if ( 'list' == $mode ) - $date = 'Y/m/d'; - else - $date = 'Y/m/d \<\b\r \/\> g:i:s a'; echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); ?>