Filter
rpress_account_orders_query_args
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#
| Parameter | Type | Description |
|---|---|---|
$args | array | WP_Query arguments. |
$user_id | int | User 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), inrpress_account_orders_query()
See also#
Was this page helpful?
