Ticket #18531: 18531.patch

File 18531.patch, 2.0 KB (added by ocean90, 21 months ago)
  • wp-admin/includes/class-wp-media-list-table.php

     
    133133                /* translators: column name */ 
    134134                $posts_columns['title'] = _x( 'File', 'column name' ); 
    135135                $posts_columns['author'] = __( 'Author' ); 
    136                 //$posts_columns['tags'] = _x( 'Tags', 'column name' ); 
    137136                /* translators: column name */ 
    138137                if ( !$this->detached ) { 
    139138                        $posts_columns['parent'] = _x( 'Attached to', 'column name' ); 
     
    237236<?php 
    238237                break; 
    239238 
    240         case 'tags': 
    241 ?> 
    242                 <td <?php echo $attributes ?>><?php 
    243                 $tags = get_the_tags(); 
    244                 if ( !empty( $tags ) ) { 
    245                         $out = array(); 
    246                         foreach ( $tags as $c ) 
    247                                 $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'post_tag', 'display' ) ) . "</a>"; 
    248                         echo join( ', ', $out ); 
    249                 } else { 
    250                         _e( 'No Tags' ); 
    251                 } 
    252 ?> 
    253                 </td> 
    254 <?php 
    255                 break; 
    256  
    257239        case 'desc': 
    258240?> 
    259241                <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td> 
     
    261243                break; 
    262244 
    263245        case 'date': 
    264                 if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) { 
    265                         $t_time = $h_time = __( 'Unpublished' ); 
     246                if ( '0000-00-00 00:00:00' == $post->post_date ) { // Needed? Media is always published. 
     247                        $h_time = __( 'Unpublished' ); 
    266248                } else { 
    267                         $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) ); 
    268249                        $m_time = $post->post_date; 
    269250                        $time = get_post_time( 'G', true, $post, false ); 
    270                         if ( ( abs( $t_diff = time() - $time ) ) < 86400 ) { 
    271                                 if ( $t_diff < 0 ) 
    272                                         $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) ); 
    273                                 else 
    274                                         $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 
     251                        if ( ( abs( $t_diff = time() - $time ) ) < 86400 && $t_diff > 0 ) { 
     252                                $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 
    275253                        } else { 
    276254                                $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); 
    277255                        }