Make WordPress Core


Ignore:
Timestamp:
10/25/2019 12:49:40 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Correct the logic in WP_Posts_List_Table::column_date() and WP_Media_List_Table::column_date() to check for a valid post timestamp.

Props Rarst.
Reviewed by azaozz, SergeyBiryukov.
See #48384.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r45932 r46578  
    10671067                        $time_diff = 0;
    10681068                } else {
    1069                         $t_time = get_the_time( __( 'Y/m/d g:i:s a' ) );
    1070                         $m_time = $post->post_date;
    1071                         $time   = get_post_time( 'G', true, $post );
    1072 
     1069                        $t_time    = get_the_time( __( 'Y/m/d g:i:s a' ), $post );
     1070                        $time      = get_post_timestamp( $post );
    10731071                        $time_diff = time() - $time;
    10741072
    1075                         if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
     1073                        if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
    10761074                                /* translators: %s: Human-readable time difference. */
    10771075                                $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
    10781076                        } else {
    1079                                 $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
     1077                                $h_time = get_the_time( __( 'Y/m/d' ), $post );
    10801078                        }
    10811079                }
    … …  
    15841582                                                $users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );
    15851583                                        }
     1584
     1585                                        /**
     1586                                         * Filters the arguments used to generate the Quick Edit authors drop-down.
     1587                                         *
     1588                                         * @since 5.3.0
     1589                                         *
     1590                                         * @see wp_dropdown_users()
     1591                                         *
     1592                                         * @param array $users_opt An array of arguments for wp_dropdown_users function.
     1593                                         * @param bool  $bulk      A boolean to know if it's a bulk action or not.
     1594                                         */
     1595                                        $users_opt = apply_filters( 'quick_edit_authors_query_args', $users_opt, $bulk );
    15861596
    15871597                                        $authors = wp_dropdown_users( $users_opt );
Note: See TracChangeset for help on using the changeset viewer.