Filter
rpress_found_customers_query
On this page
Filters the query used to retrieve the count of found customers.
Used by RPRESS_Customer_Query::set_found_items() when the total number of matches is needed. The default query is SELECT FOUND_ROWS(), and the result is run through $wpdb->get_var(). Return a custom SQL string only if you replace the main query logic as well.
Available since RestroPress 1.0.0.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$found_customers_query | string | SQL query. Default is 'SELECT FOUND_ROWS()'. |
$customer_query | RPRESS_Customer_Query | The query instance. |
Return value#
string. The SQL query used to count found customers.
Example#
function my_found_customers_query( $found_customers_query, $customer_query ) {
return $found_customers_query;
}
add_filter( 'rpress_found_customers_query', 'my_found_customers_query', 10, 2 );
Source#
Applied in:
includes/class-rpress-customer-query.php(line 379), inRPRESS_Customer_Query::set_found_items()
Was this page helpful?
