Skip to content

Commit

Permalink
Add search box to list table
Browse files Browse the repository at this point in the history
  • Loading branch information
thenbrent committed Apr 13, 2018
1 parent a25c2b4 commit dfd741f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/ActionScheduler_ListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ public function __construct( ActionScheduler_Store $store, ActionScheduler_Logge
'group',
);

$this->search_by = array(
'hook',
'args',
'claim_id',
);

$request_status = $this->get_request_status();

if ( empty( $request_status ) ) {
Expand Down Expand Up @@ -460,6 +466,7 @@ public function prepare_items() {
'status' => $this->get_request_status(),
'orderby' => $this->get_request_orderby(),
'order' => $this->get_request_order(),
'search' => $this->get_request_search_query(),
);

$this->items = array();
Expand Down Expand Up @@ -497,4 +504,11 @@ protected function display_filter_by_status() {
$this->status_counts = $this->store->action_counts();
parent::display_filter_by_status();
}

/**
* Get the text to display in the search box on the list table.
*/
protected function get_search_box_button_text() {
return __( 'Search hook, args and claim ID', 'action-scheduler' );
}
}

0 comments on commit dfd741f

Please sign in to comment.