WordPress.org

Make WordPress Core

Ticket #16341: 16341.2.patch

File 16341.2.patch, 5.7 KB (added by SergeyBiryukov, 7 years ago)
  • 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.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<?php if ( ! empty($_REQUEST['orderby']) ) : ?>
     696<input type="hidden" name="orderby" value="<?php echo esc_attr($_REQUEST['orderby']); ?>" />
     697<?php endif; ?>
     698<?php if ( ! empty($_REQUEST['order']) ) : ?>
     699<input type="hidden" name="order" value="<?php echo esc_attr($_REQUEST['order']); ?>" />
     700<?php endif; ?>
     701<?php
     702        }
     703
     704        /**
    689705         * Display the table
    690706         *
    691707         * @since 3.1.0
  • 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/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/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