Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This hook can be used to customize the admin entries search.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter( 'frm_filter_admin_entries', 'custom_query', 10, 2 );
Parameters
- $query (array) the query to add to the entry search
- $args (array)
- field_id (string) the option value selected in the search
search (string) the searched value
- field_id (string) the option value selected in the search
Examples
Modify the search value
This example will modify the search value of a query in an entry search.
add_filter( 'frm_filter_admin_entries', 'custom_query', 10, 2 );
function custom_query( $query, $args ) {
$fid = 'id';
if ( $args['field_id'] === $fid ) {
$query['it.' . $fid][0] = 'new value to search';
}
return $query;
}
Use with frm_admin_search_options hook