Skip to content
Docs
Get RestroPress

Filter

rpress_account_orders_query_args

Updated
On this page

Filters the WP_Query arguments for a customer's order list.

Used by rpress_account_orders_query() for the account Orders section, [rpress_order_history] and "Load more". By default it queries rpress_payment posts newest first, limited with post__in to the orders linked to the customer record, or with author when the record has no orders listed or does not exist. Keep that restriction in place, or customers can see other people's orders.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$argsarrayWP_Query arguments.
$user_idintUser whose orders are listed.

Return value#

array. WP_Query arguments.

Example#

add_filter( 'rpress_account_orders_query_args', 'my_account_orders_args', 10, 2 );
function my_account_orders_args( $args, $user_id ) {
	$args['date_query'] = array(
		array( 'after' => '12 months ago' ),
	);
	return $args;
}

Source#

Applied in:

  • includes/features/account/orders.php (line 58), in rpress_account_orders_query()

See also#

Was this page helpful?