WordPress.org

Make WordPress Core

Ticket #16341: 16341.4.patch

File 16341.4.patch, 12.2 KB (added by SergeyBiryukov, 7 years ago)

Fixed themes search on Edit Site screen

  • wp-admin/edit-comments.php

     
    222222
    223223<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
    224224
    225 <?php if ( $post_id ) : ?>
    226 <input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
    227 <?php endif; ?>
    228 <input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
    229 <input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
     225<?php $wp_list_table->hidden_fields(); ?>
    230226
    231 <input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
    232 <input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
    233 <input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
    234 
    235 <?php if ( isset($_REQUEST['paged']) ) { ?>
    236         <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
    237 <?php } ?>
    238 
    239227<?php $wp_list_table->display(); ?>
    240228</form>
    241229</div>
  • wp-admin/edit-tags.php

     
    238238<div id="ajax-response"></div>
    239239
    240240<form class="search-form" action="" method="get">
    241 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
    242 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
    243241
    244242<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
    245243
     244<?php $wp_list_table->hidden_fields(); ?>
     245
    246246</form>
    247247<br class="clear" />
    248248
  • wp-admin/edit.php

     
    244244
    245245<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
    246246
    247 <input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
    248 <input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
     247<?php $wp_list_table->hidden_fields(); ?>
    249248
    250249<?php $wp_list_table->display(); ?>
    251250
  • wp-admin/includes/class-wp-comments-list-table.php

     
    265265                );
    266266        }
    267267
     268        function hidden_fields() {
     269                global $post_id, $comment_status;
     270?>
     271<?php if ( $post_id ) : ?>
     272<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
     273<?php endif; ?>
     274<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
     275<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
     276
     277<input type="hidden" name="_total" value="<?php echo esc_attr( $this->get_pagination_arg('total_items') ); ?>" />
     278<input type="hidden" name="_per_page" value="<?php echo esc_attr( $this->get_pagination_arg('per_page') ); ?>" />
     279<input type="hidden" name="_page" value="<?php echo esc_attr( $this->get_pagination_arg('page') ); ?>" />
     280
     281<?php if ( isset($_REQUEST['paged']) ) : ?>
     282        <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
     283<?php endif; ?>
     284<?php
     285                parent::hidden_fields();
     286        }
     287
    268288        function display() {
    269289                extract( $this->_args );
    270290
  • wp-admin/includes/class-wp-list-table.php

     
    686686        }
    687687
    688688        /**
     689         * Add hidden fields to keep sorting after searching
     690         *
     691         * @since 3.1.0
     692         * @access public
     693         */
     694        function hidden_fields() {
     695?>
     696<?php if ( ! empty($_REQUEST['orderby']) ) : ?>
     697<input type="hidden" name="orderby" value="<?php echo esc_attr($_REQUEST['orderby']); ?>" />
     698<?php endif; ?>
     699<?php if ( ! empty($_REQUEST['order']) ) : ?>
     700<input type="hidden" name="order" value="<?php echo esc_attr($_REQUEST['order']); ?>" />
     701<?php endif; ?>
     702<?php
     703        }
     704
     705        /**
    689706         * Display the table
    690707         *
    691708         * @since 3.1.0
  • wp-admin/includes/class-wp-ms-sites-list-table.php

     
    165165                );
    166166        }
    167167
     168        function hidden_fields() {
     169?>
     170<input type="hidden" name="action" value="blogs" />
     171<?php
     172                parent::hidden_fields();
     173        }
     174
    168175        function display_rows() {
    169176                global $current_site, $mode;
    170177
  • wp-admin/includes/class-wp-ms-themes-list-table.php

     
    254254                return parent::current_action();
    255255        }
    256256
     257        function hidden_fields() {
     258                global $id;
     259                if ( ! empty($id) ) :
     260?>
     261<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
     262<?php
     263                endif;
     264                parent::hidden_fields();
     265        }
     266
    257267        function display_rows() {
    258268                foreach ( $this->items as $key => $theme )
    259269                        $this->single_row( $key, $theme );
  • wp-admin/includes/class-wp-plugins-list-table.php

     
    296296                return parent::current_action();
    297297        }
    298298
     299        function hidden_fields() {
     300                global $status, $page;
     301?>
     302<input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" />
     303<input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" />
     304<?php
     305                parent::hidden_fields();
     306        }
     307
    299308        function display_rows() {
    300309                global $status;
    301310
  • wp-admin/includes/class-wp-posts-list-table.php

     
    304304                );
    305305        }
    306306
     307        function hidden_fields() {
     308                global $post_type;
     309?>
     310<input type="hidden" name="post_status" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
     311<input type="hidden" name="post_type" value="<?php echo $post_type; ?>" />
     312<?php
     313                parent::hidden_fields();
     314        }
     315
    307316        function display_rows( $posts = array() ) {
    308317                global $wp_query, $post_type_object, $per_page;
    309318
  • wp-admin/includes/class-wp-terms-list-table.php

     
    123123                );
    124124        }
    125125
     126        function hidden_fields() {
     127                global $taxonomy, $post_type;
     128?>
     129<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
     130<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
     131<?php
     132                parent::hidden_fields();
     133        }
     134
    126135        function display_rows_or_placeholder() {
    127136                global $taxonomy;
    128137
  • wp-admin/includes/class-wp-users-list-table.php

     
    180180                return $c;
    181181        }
    182182
     183        function hidden_fields() {
     184                global $id;
     185                if ( ! empty($id) ) :
     186?>
     187<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
     188<?php
     189                endif;
     190                parent::hidden_fields();
     191        }
     192
    183193        function display_rows() {
    184194                // Query the post counts for this page
    185195                if ( ! $this->is_site_users )
  • wp-admin/link-manager.php

     
    7878
    7979<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>
    8080
     81<?php $wp_list_table->hidden_fields(); ?>
     82
    8183<?php $wp_list_table->display(); ?>
    8284
    8385<div id="ajax-response"></div>
  • wp-admin/network/site-themes.php

     
    162162
    163163<form method="get" action="">
    164164<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
    165 <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
     165<?php $wp_list_table->hidden_fields(); ?>
    166166</form>
    167167
    168168<?php $wp_list_table->views(); ?>
  • wp-admin/network/site-users.php

     
    218218
    219219<form class="search-form" action="" method="get">
    220220<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
    221 <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
     221<?php $wp_list_table->hidden_fields(); ?>
    222222</form>
    223223
    224224<?php $wp_list_table->views(); ?>
  • wp-admin/network/sites.php

     
    112112
    113113<form action="" method="get" id="ms-search">
    114114<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
    115 <input type="hidden" name="action" value="blogs" />
     115<?php $wp_list_table->hidden_fields(); ?>
    116116</form>
    117117
    118118<form id="form-site-list" action="edit.php?action=allblogs" method="post">
  • wp-admin/network/themes.php

     
    224224
    225225<form method="get" action="">
    226226<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
     227<?php $wp_list_table->hidden_fields(); ?>
    227228</form>
    228229
    229230<?php $wp_list_table->views(); ?>
  • wp-admin/network/users.php

     
    8080
    8181        <form action="" method="get" class="search-form">
    8282                <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
     83                <?php $wp_list_table->hidden_fields(); ?>
    8384        </form>
    8485
    8586        <form id="form-user-list" action='edit.php?action=allusers' method='post'>
  • wp-admin/plugins.php

     
    404404
    405405<?php $wp_list_table->search_box( __( 'Search Plugins' ), 'plugin' ); ?>
    406406
    407 <input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" />
    408 <input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" />
     407<?php $wp_list_table->hidden_fields(); ?>
    409408
    410409<?php
    411410if ( 'mustuse' == $status )
  • wp-admin/upload.php

     
    215215
    216216<?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?>
    217217
     218<?php $wp_list_table->hidden_fields(); ?>
     219
    218220<?php $wp_list_table->display(); ?>
    219221
    220222<div id="ajax-response"></div>
  • wp-admin/users.php

     
    362362
    363363<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
    364364
     365<?php $wp_list_table->hidden_fields(); ?>
     366
    365367<?php $wp_list_table->display(); ?>
    366368</form>
    367369