Make WordPress Core

Ticket #28555: 28555.2.diff

File 28555.2.diff, 3.1 KB (added by jesin, 10 years ago)

Adds name attribute to "Filter" buttons & checks it in current_action()

  • wp-admin/includes/class-wp-posts-list-table.php

     
    233233                         */
    234234                        do_action( 'restrict_manage_posts' );
    235235
    236                         submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
     236                        submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    237237                }
    238238
    239239                if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
  • wp-admin/includes/class-wp-media-list-table.php

     
    9494
    9595                        /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
    9696                        do_action( 'restrict_manage_posts' );
    97                         submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
     97                        submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    9898                }
    9999
    100100                if ( $this->detached ) {
  • wp-admin/includes/class-wp-links-list-table.php

     
    6969                                'orderby' => 'name',
    7070                        );
    7171                        wp_dropdown_categories( $dropdown_options );
    72                         submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
     72                        submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    7373?>
    7474                </div>
    7575<?php
  • wp-admin/includes/class-wp-comments-list-table.php

     
    258258                         * @since 3.5.0
    259259                         */
    260260                        do_action( 'restrict_manage_comments' );
    261                         submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
     261                        submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
    262262                }
    263263
    264264                if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
  • wp-admin/includes/class-wp-list-table.php

     
    384384         * @return string|bool The action name or False if no action was selected
    385385         */
    386386        public function current_action() {
     387                if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
     388                        return false;
     389
    387390                if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
    388391                        return $_REQUEST['action'];
    389392