- Timestamp:
- 07/10/2020 04:02:00 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r48415 r48424 81 81 * @global int $post_id 82 82 * @global string $comment_status 83 * @global string $comment_type 83 84 * @global string $search 84 * @global string $comment_type85 85 */ 86 86 public function prepare_items() { 87 global $post_id, $comment_status, $search, $comment_type; 87 global $post_id, $comment_status, $comment_type, $search; 88 89 if ( ! empty( $_REQUEST['mode'] ) ) { 90 $mode = 'extended' === $_REQUEST['mode'] ? 'extended' : 'list'; 91 set_user_setting( 'posts_list_mode', $mode ); 92 } 88 93 89 94 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; … … 123 128 if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) { 124 129 $start += $_REQUEST['offset']; 125 }126 127 if ( ! empty( $_REQUEST['mode'] ) ) {128 $mode = 'extended' === $_REQUEST['mode'] ? 'extended' : 'list';129 set_user_setting( 'posts_list_mode', $mode );130 } else {131 $mode = get_user_setting( 'posts_list_mode', 'list' );132 130 } 133 131 … … 760 758 761 759 $always_visible = false; 762 $mode = get_user_setting( 'posts_list_mode', 'list' ); 760 761 $mode = get_user_setting( 'posts_list_mode', 'list' ); 762 763 763 if ( 'extended' === $mode ) { 764 764 $always_visible = true; 765 765 } 766 766 767 $i = 0;768 767 $out .= '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; 768 769 $i = 0; 770 769 771 foreach ( $actions as $action => $link ) { 770 772 ++$i; 771 ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 772 773 // Reply and quickedit need a hide-if-no-js span when not added with ajax. 773 774 if ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) 775 || 1 === $i 776 ) { 777 $sep = ''; 778 } else { 779 $sep = ' | '; 780 } 781 782 // Reply and quickedit need a hide-if-no-js span when not added with Ajax. 774 783 if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) { 775 784 $action .= ' hide-if-no-js'; 776 } elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status ) || ( 'unspam' === $action && 'spam' === $the_comment_status ) ) { 785 } elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status ) 786 || ( 'unspam' === $action && 'spam' === $the_comment_status ) 787 ) { 777 788 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) { 778 789 $action .= ' approve'; … … 784 795 $out .= "<span class='$action'>$sep$link</span>"; 785 796 } 797 786 798 $out .= '</div>'; 787 799
Note: See TracChangeset
for help on using the changeset viewer.