Automattic\WooCommerce\Internal\OrderReviews

Endpoint::maybe_flush_pending_rewritepublicWC 1.0

Flush rewrite rules once after the Review Order page is seeded or republished.

maybe_create_host_page() runs on init priority 4 and queues the flush by setting woocommerce_review_order_flush_rewrite_pending; add_rewrite_rule() fire until init priority 10, so the flush has to happen later. wp_loaded after every init callback, which is the earliest safe moment.

Method of the class: Endpoint{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Endpoint = new Endpoint();
$Endpoint->maybe_flush_pending_rewrite(): void;

Endpoint::maybe_flush_pending_rewrite() code WC 10.9.4

public function maybe_flush_pending_rewrite(): void {
	if ( 'yes' !== get_option( 'woocommerce_review_order_flush_rewrite_pending' ) ) {
		return;
	}
	flush_rewrite_rules( false );
	delete_option( 'woocommerce_review_order_flush_rewrite_pending' );
}