Make WordPress Core

Ticket #22222: 22222.4.patch

File 22222.4.patch, 4.3 KB (added by Oxymoron, 8 years ago)

updates per Helen's notes

  • src/wp-admin/edit.php

     
    195195                '<ul>' .
    196196                        '<li>' . __('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.') . '</li>' .
    197197                        '<li>' . __('You can filter the list of posts by post status using the text links in the upper left to show All, Published, Draft, or Trashed posts. The default view is to show all posts.') . '</li>' .
    198                         '<li>' . __('You can view posts in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.') . '</li>' .
     198                        '<li>' . __('You can view posts in a simple title list or with an excerpt using the Screen Options tab.') . '</li>' .
    199199                        '<li>' . __('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.') . '</li>' .
    200200                '</ul>'
    201201        ) );
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    498498                global $mode;
    499499
    500500                parent::pagination( $which );
    501 
    502                 if ( 'top' === $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
    503                         $this->view_switcher( $mode );
    504501        }
    505502
    506503        /**
  • src/wp-admin/includes/class-wp-screen.php

     
    969969         */
    970970        public function render_screen_options( $options = array() ) {
    971971                global $wp_meta_boxes;
     972                global $mode;
    972973                $options = wp_parse_args( $options, array(
    973974                        'wrap' => true,
    974975                ) );
     
    10351036                        </div>
    10361037                <?php endif;
    10371038
     1039                /**
     1040                 * Filter the post types that have different view mode options.
     1041                 *
     1042                 * @since 4.4.0
     1043                 *
     1044                 * @param array $view_mode_post_types Array of post types that can change view modes.
     1045                 */
     1046                $view_mode_post_types = apply_filters( 'view_mode_post_types', get_post_types( array( 'hierarchical' => false, 'show_ui' => true ) ) );
     1047                if ( in_array( $this->post_type, $view_mode_post_types ) ) { ?>
     1048                <div class="view-modes">
     1049                        <h5><?php _e( 'View Mode' ); ?></h5>
     1050                        <label for="list-view-mode">
     1051                                <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> />
     1052                                <?php _e( 'List View' ); ?>
     1053                        </label>
     1054                        <label for="excerpt-view-mode">
     1055                                <input id="excerpt-view-mode" type="radio" name="mode" value="excerpt" <?php checked( 'excerpt', $mode ); ?> />
     1056                                <?php _e( 'Excerpt View' ); ?>
     1057                        </label>
     1058                </div>
     1059                <?php }
    10381060                $this->render_screen_layout();
    10391061                $this->render_per_page_options();
    10401062                echo $this->_screen_settings;
     
    11301152                                <input type="number" step="1" min="1" max="999" class="screen-per-page" name="wp_screen_options[value]"
    11311153                                        id="<?php echo esc_attr( $option ); ?>" maxlength="3"
    11321154                                        value="<?php echo esc_attr( $per_page ); ?>" />
    1133                         <?php endif;
     1155                        <?php endif; ?>
    11341156
    1135                         echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?>
     1157                        <p><?php echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?></p>
    11361158                        <input type="hidden" name="wp_screen_options[option]" value="<?php echo esc_attr( $option ); ?>" />
    11371159                </div>
    11381160                <?php
  • src/wp-admin/includes/misc.php

     
    459459                }
    460460
    461461                update_user_meta($user->ID, $option, $value);
    462                 wp_safe_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
     462
     463                $url = remove_query_arg( array( 'pagenum', 'apage', 'paged' ), wp_get_referer() );
     464                if ( isset( $_POST['mode'] ) ) {
     465                        $url = add_query_arg( array( 'mode' => $_POST['mode'] ), $url );
     466                }
     467
     468                wp_safe_redirect( $url );
    463469                exit;
    464470        }
    465471}