woocommerce_review_order_eligible_statuses filter-hookWC 10.8.0

Filter the order statuses that are eligible to receive the review-request email.

Same hook the email's trigger() consults at send time; documented on WC_Email_Customer_Review_Request::is_order_eligible_for_send().

Usage

add_filter( 'woocommerce_review_order_eligible_statuses', 'wp_kama_woocommerce_review_order_eligible_statuses_filter', 10, 2 );

/**
 * Function for `woocommerce_review_order_eligible_statuses` filter-hook.
 * 
 * @param string[]      $eligible_statuses Default: `[ 'completed' ]`.
 * @param WC_Order|null $order             Order being inspected, or null if it could not be loaded.
 *
 * @return string[]
 */
function wp_kama_woocommerce_review_order_eligible_statuses_filter( $eligible_statuses, $order ){

	// filter...
	return $eligible_statuses;
}
$eligible_statuses(string[])
Default: [ 'completed' ].
$order(WC_Order|null)
Order being inspected, or null if it could not be loaded.

Changelog

Since 10.8.0 Introduced.

Where the hook is called

Scheduler::handle_status_changed()
woocommerce_review_order_eligible_statuses
Endpoint::is_authorised()
woocommerce_review_order_eligible_statuses
SubmissionHandler::handle()
woocommerce_review_order_eligible_statuses
WC_Email_Customer_Review_Request::is_order_eligible_for_send()
woocommerce_review_order_eligible_statuses
woocommerce/src/Internal/OrderReviews/Scheduler.php 99-103
$eligible_statuses = (array) apply_filters(
	'woocommerce_review_order_eligible_statuses',
	array( OrderStatus::COMPLETED ),
	$order instanceof WC_Order ? $order : null
);
woocommerce/src/Internal/OrderReviews/Endpoint.php 699-703
$eligible_statuses = (array) apply_filters(
	'woocommerce_review_order_eligible_statuses',
	array( OrderStatus::COMPLETED ),
	$order
);
woocommerce/src/Internal/OrderReviews/SubmissionHandler.php 89-93
$eligible_statuses = (array) apply_filters(
	'woocommerce_review_order_eligible_statuses',
	array( OrderStatus::COMPLETED ),
	$order
);
woocommerce/includes/emails/class-wc-email-customer-review-request.php 138-142
$eligible_statuses = (array) apply_filters(
	'woocommerce_review_order_eligible_statuses',
	array( OrderStatus::COMPLETED ),
	$this->object
);

Where the hook is used in WooCommerce

Usage not found.