Changeset 48424
- Timestamp:
- 07/10/2020 04:02:00 PM (4 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 7 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 -
trunk/src/wp-admin/includes/class-wp-list-table.php
r48415 r48424 167 167 if ( empty( $this->modes ) ) { 168 168 $this->modes = array( 169 'list' => __( 'Compact View' ),170 'extended' => __( 'Extended View' ),169 'list' => __( 'Compact view' ), 170 'extended' => __( 'Extended view' ), 171 171 ); 172 172 } … … 518 518 protected function row_actions( $actions, $always_visible = false ) { 519 519 $action_count = count( $actions ); 520 $i = 0;521 520 522 521 if ( ! $action_count ) { … … 525 524 526 525 $mode = get_user_setting( 'posts_list_mode', 'list' ); 526 527 527 if ( 'extended' === $mode ) { 528 528 $always_visible = true; … … 530 530 531 531 $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; 532 533 $i = 0; 534 532 535 foreach ( $actions as $action => $link ) { 533 536 ++$i; 534 ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 535 $out .= "<span class='$action'>$link$sep</span>"; 536 } 537 538 $sep = ( $i < $action_count ) ? ' | ' : ''; 539 540 $out .= "<span class='$action'>$link$sep</span>"; 541 } 542 537 543 $out .= '</div>'; 538 544 … … 1253 1259 */ 1254 1260 protected function get_table_classes() { 1255 $mode = get_user_setting( 'posts_list_mode', 'list' ); 1256 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-list'; 1257 $mode = get_user_setting( 'posts_list_mode', 'list' ); 1258 /** 1259 * Filters the current view mode. 1260 * 1261 * @since 5.5.0 1262 * 1263 * @param string $mode The current selected mode. Default value of 1264 * posts_list_mode user setting. 1265 */ 1261 $mode = get_user_setting( 'posts_list_mode', 'list' ); 1262 1263 /** This filter is documented in wp-admin/includes/class-wp-screen.php */ 1266 1264 $mode = apply_filters( 'table_view_mode', $mode ); 1267 1265 1268 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-' . $mode;1266 $mode_class = esc_attr( 'table-view-' . $mode ); 1269 1267 1270 1268 return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] ); -
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r48417 r48424 62 62 63 63 /** 64 * @global string $mode List table view mode. 64 65 * @global WP_Query $wp_query WordPress Query object. 65 66 * @global array $post_mime_types 66 67 * @global array $avail_post_mime_types 67 * @global string $mode68 68 */ 69 69 public function prepare_items() { 70 global $wp_query, $post_mime_types, $avail_post_mime_types, $mode; 70 global $mode, $wp_query, $post_mime_types, $avail_post_mime_types; 71 72 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; 71 73 72 74 // Exclude attachments scheduled for deletion in the next two hours … … 96 98 97 99 $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter']; 98 99 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];100 100 101 101 $this->set_pagination_args( -
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r47219 r48424 63 63 * @since 3.1.0 64 64 * 65 * @global string $mode List table view mode. 65 66 * @global string $s 66 * @global string $mode67 67 * @global wpdb $wpdb WordPress database abstraction object. 68 68 */ 69 69 public function prepare_items() { 70 global $ s, $mode, $wpdb;70 global $mode, $s, $wpdb; 71 71 72 72 if ( ! empty( $_REQUEST['mode'] ) ) { … … 577 577 578 578 /** 579 * @global string $mode 579 * @global string $mode List table view mode. 580 580 */ 581 581 public function display_rows() { -
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r47557 r48424 25 25 26 26 /** 27 * @global string $mode List table view mode. 27 28 * @global string $usersearch 28 29 * @global string $role 29 * @global string $mode30 30 */ 31 31 public function prepare_items() { 32 global $usersearch, $role, $mode; 32 global $mode, $usersearch, $role; 33 34 if ( ! empty( $_REQUEST['mode'] ) ) { 35 $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list'; 36 set_user_setting( 'network_users_list_mode', $mode ); 37 } else { 38 $mode = get_user_setting( 'network_users_list_mode', 'list' ); 39 } 33 40 34 41 $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : ''; … … 82 89 if ( isset( $_REQUEST['order'] ) ) { 83 90 $args['order'] = $_REQUEST['order']; 84 }85 86 if ( ! empty( $_REQUEST['mode'] ) ) {87 $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';88 set_user_setting( 'network_users_list_mode', $mode );89 } else {90 $mode = get_user_setting( 'network_users_list_mode', 'list' );91 91 } 92 92 … … 423 423 $actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id ); 424 424 425 $i = 0;426 425 $action_count = count( $actions ); 426 427 $i = 0; 428 427 429 foreach ( $actions as $action => $link ) { 428 430 ++$i; 429 $sep = ( $i == $action_count ) ? '' : ' | '; 431 432 $sep = ( $i < $action_count ) ? ' | ' : ''; 433 430 434 echo "<span class='$action'>$link$sep</span>"; 431 435 } 436 432 437 echo '</small></span><br/>'; 433 438 } -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r48415 r48424 136 136 137 137 /** 138 * @global string $mode List table view mode. 138 139 * @global array $avail_post_stati 139 140 * @global WP_Query $wp_query WordPress Query object. 140 141 * @global int $per_page 141 * @global string $mode142 142 */ 143 143 public function prepare_items() { 144 global $avail_post_stati, $wp_query, $per_page, $mode; 144 global $mode, $avail_post_stati, $wp_query, $per_page; 145 146 if ( ! empty( $_REQUEST['mode'] ) ) { 147 $mode = 'extended' === $_REQUEST['mode'] ? 'extended' : 'list'; 148 set_user_setting( 'posts_list_mode', $mode ); 149 } else { 150 $mode = get_user_setting( 'posts_list_mode', 'list' ); 151 } 145 152 146 153 // Is going to call wp(). … … 176 183 } 177 184 } 178 }179 180 if ( ! empty( $_REQUEST['mode'] ) ) {181 $mode = 'extended' === $_REQUEST['mode'] ? 'extended' : 'list';182 set_user_setting( 'posts_list_mode', $mode );183 } else {184 $mode = get_user_setting( 'posts_list_mode', 'list' );185 185 } 186 186 … … 596 596 597 597 /** 598 * @global string $mode List table view mode. 599 * 598 600 * @return array 599 601 */ 600 602 protected function get_table_classes() { 601 $mode = get_user_setting( 'posts_list_mode', 'list' ); 602 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-list'; 603 $mode = get_user_setting( 'posts_list_mode', 'list' ); 604 /** 605 * Filters the current view mode. 606 * 607 * @since 5.5.0 608 * 609 * @param string $mode The current selected mode. Default value of 610 * posts_list_mode user setting. 611 */ 603 global $mode; 604 605 /** This filter is documented in wp-admin/includes/class-wp-screen.php */ 612 606 $mode = apply_filters( 'table_view_mode', $mode ); 613 607 614 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-' . $mode;608 $mode_class = esc_attr( 'table-view-' . $mode ); 615 609 616 610 return array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' ); -
trunk/src/wp-admin/includes/dashboard.php
r48191 r48424 757 757 758 758 $i = 0; 759 759 760 foreach ( $actions as $action => $link ) { 760 761 ++$i; 761 762 762 if ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) { 763 if ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) 764 || 1 === $i 765 ) { 763 766 $sep = ''; 764 767 } else {
Note: See TracChangeset
for help on using the changeset viewer.