WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/22/2010 12:10:39 AM (10 years ago)
Author:
scribu
Message:

Introduce WP_List_Table::current_action() and use throughout admin list screens. See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/list-table.php

    r15629 r15642  
    245245
    246246        echo "<input type='submit' value='" . esc_attr__( 'Apply' ) . "' name='doaction$two' id='doaction$two' class='button-secondary action' />\n";
     247    }
     248
     249    /**
     250     * Get the current action selected from the bulk actions dropdown.
     251     *
     252     * @since 3.1.0
     253     * @access public
     254     *
     255     * @return string|bool The action name or False if no action was selected
     256     */
     257    function current_action() {
     258        if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
     259            return $_REQUEST['action'];
     260
     261        if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
     262            return $_REQUEST['action2'];
     263       
     264        return false;
    247265    }
    248266
Note: See TracChangeset for help on using the changeset viewer.