Skip to content
Docs
Get RestroPress

Filter

rpress_account_hub_reorder_line_problem

Updated
On this page

Filters the reason a past order line cannot be reordered.

Runs for each line of a past order during reorder, after core checks. Core returns 'missing', 'unavailable' or 'option_gone' before this filter is reached. An empty string means the line can be bought again; any non-empty string causes the line to be skipped and listed as skipped.

Parameters#

ParameterTypeDescription
$problemstringReason code, empty string when the line is fine.
$linearrayOrder line from rpress_get_payment_meta_cart_details().

Return value#

string. Reason code, or an empty string if the line can be reordered.

Example#

add_filter( 'rpress_account_hub_reorder_line_problem', 'my_reorder_problem', 10, 2 );
function my_reorder_problem( $problem, $line ) {
	if ( '' === $problem && ! empty( $line['id'] ) && get_post_meta( $line['id'], '_my_seasonal_off', true ) ) {
		return 'unavailable';
	}
	return $problem;
}

Source#

Applied in:

  • includes/features/account-hub/reorder.php (line 71), in rpress_account_hub_reorder_line_problem()

See also#

Was this page helpful?