Set date format before going into the loop to avoid a PHP notice if 'lastupdated' column is filtered out.

props jeremyfelt.
fixes #27614.
Built from https://develop.svn.wordpress.org/trunk@28898


git-svn-id: http://core.svn.wordpress.org/trunk@28697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-06-29 18:11:14 +00:00
parent ae0e22b61c
commit 08cea559a5
1 changed files with 6 additions and 4 deletions

View File

@ -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 "<td class='$column_name column-$column_name'$style>";
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'] ); ?>
</td>
<?php