Skip to content
Docs
Get RestroPress

Filter

rpress_count_payments_join

Updated
On this page

Filters the JOIN clause used by rpress_count_payments().

Runs after rpress_count_payments() has built its JOIN clause (postmeta joins for the user, customer, gateway, service type, order status and service date arguments) and before the grouped count query runs. Use it together with the WHERE filter to join extra tables or meta rows. The posts table is aliased as p.

Parameters#

ParameterTypeDescription
$joinstringThe SQL JOIN clause; may be an empty string.

Return value#

string. The modified JOIN clause.

Example#

add_filter( 'rpress_count_payments_join', 'my_join_vendor_meta_for_counts', 10, 1 );
function my_join_vendor_meta_for_counts( $join ) {
	global $wpdb;
	return $join . " LEFT JOIN {$wpdb->postmeta} vm ON (p.ID = vm.post_id AND vm.meta_key = '_my_vendor_id')";
}

Source#

Applied in:

  • includes/payments/functions.php (line 717), in rpress_count_payments()

See also#

Was this page helpful?