Skip to content
Docs
Get RestroPress

Filter

rpress_found_customers_query

Updated
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#

ParameterTypeDescription
$found_customers_querystringSQL query. Default is 'SELECT FOUND_ROWS()'.
$customer_queryRPRESS_Customer_QueryThe 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), in RPRESS_Customer_Query::set_found_items()
Was this page helpful?