Make WordPress Core

Ticket #46872: 46872.diff

File 46872.diff, 989 bytes (added by garrett-eclipse, 6 years ago)

Initial working patch to apply the doaction[2] string as the name attribute on the submit input. This will allow us to know which button was clicked.

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

     
    473473
    474474                echo "</select>\n";
    475475
    476                 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
     476                submit_button( __( 'Apply' ), 'action', "doaction$two", false, array( 'id' => "doaction$two" ) );
    477477                echo "\n";
    478478        }
    479479
     
    489489                        return false;
    490490                }
    491491
    492                 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
     492                if ( isset( $_REQUEST['doaction'] ) && isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
    493493                        return $_REQUEST['action'];
    494494                }
    495495
    496                 if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
     496                if ( isset( $_REQUEST['doaction2'] ) && isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
    497497                        return $_REQUEST['action2'];
    498498                }
    499499