Action hooks to add search actions and filters

Two action hooks were added to enhance searching: wpda_add_search_actions and wpda_add_search_filter. Use these actions to customize the search box of your list table. These action hooks apply to WordPress list tables only. They do not affect publications.

Action hook wpda_add_search_actions

Added to allow developers to add actions to the search bar (e.g. an icon).

public function my_add_search_actions( $schema_name, $table_name, $table_settings, $wpda_list_columns ) {
	// Your code goes here...
}
add_action( 'wpda_add_search_actions', 'my_add_search_actions', 10, 4 );

Action hook wpda_add_search_filter

Added to allow developers to add their own HTML and JavaScript to the search bar.

public function my_add_search_filter( $schema_name, $table_name, $table_settings, $wpda_list_columns ) {
	// Your code goes here...
}
add_action( 'wpda_add_search_filter', 'my_add_search_filter', 10, 4 );

Parameters

Both action hooks are using the same parameters:

$schema_name

Database schema name (datebase name)

$table_name

Database table name

$table_settings

Table settings as defined in the Data Explorer

$wpda_list_columns

Reference to column list (instance of class WPDA_List_Columns)

Peter Schulz is a lecturer in information technology at the HAN university of applied sciences. He is an experienced programmer with more than 25 years experience in Oracle databases and tools. Peter is the developer of WordPress plugin WP Data Access.

Leave a Reply

Your email address will not be published. Required fields are marked *