Make WordPress Core

Ticket #22222: 22222.diff

File 22222.diff, 4.1 KB (added by helen, 11 years ago)
  • 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

     
    515515                global $mode;
    516516
    517517                parent::pagination( $which );
    518 
    519                 if ( 'top' === $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
    520                         $this->view_switcher( $mode );
    521518        }
    522519
    523520        /**
  • src/wp-admin/includes/class-wp-screen.php

     
    991991                $this->render_list_table_columns_preferences();
    992992                $this->render_screen_layout();
    993993                $this->render_per_page_options();
     994                $this->render_view_mode();
    994995                echo $this->_screen_settings;
    995996
    996997                /**
     
    11881189        }
    11891190
    11901191        /**
     1192         * Render the list table view mode preferences.
     1193         *
     1194         * @since 4.4.0
     1195         */
     1196        public function render_view_mode() {
     1197                /**
     1198                 * Filter the post types that have different view mode options.
     1199                 *
     1200                 * @since 4.4.0
     1201                 *
     1202                 * @param array $view_mode_post_types Array of post types that can change view modes.
     1203                 *                                    Default hierarchical post types with show_ui on.
     1204                 */
     1205                $view_mode_post_types = get_post_types( array( 'hierarchical' => false, 'show_ui' => true ) );
     1206                $view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
     1207
     1208                if ( ! in_array( $this->post_type, $view_mode_post_types ) ) {
     1209                        return;
     1210                }
     1211
     1212                global $mode;
     1213
     1214                // This needs a submit button
     1215                add_filter( 'screen_options_show_submit', '__return_true' );
     1216?>
     1217                <fieldset class="metabox-prefs view-mode">
     1218                <legend><?php _e( 'View Mode' ); ?></legend>
     1219                                <label for="list-view-mode">
     1220                                        <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> />
     1221                                        <?php _e( 'List View' ); ?>
     1222                                </label>
     1223                                <label for="excerpt-view-mode">
     1224                                        <input id="excerpt-view-mode" type="radio" name="mode" value="excerpt" <?php checked( 'excerpt', $mode ); ?> />
     1225                                        <?php _e( 'Excerpt View' ); ?>
     1226                                </label>
     1227                </fieldset>
     1228<?php
     1229        }
     1230
     1231        /**
    11911232         * Render screen reader text.
    11921233         *
    11931234         * @since 4.4.0
  • src/wp-admin/includes/misc.php

     
    476476                }
    477477
    478478                update_user_meta($user->ID, $option, $value);
    479                 wp_safe_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
     479
     480                $url = remove_query_arg( array( 'pagenum', 'apage', 'paged' ), wp_get_referer() );
     481                if ( isset( $_POST['mode'] ) ) {
     482                        $url = add_query_arg( array( 'mode' => $_POST['mode'] ), $url );
     483                }
     484
     485                wp_safe_redirect( $url );
    480486                exit;
    481487        }
    482488}