Automattic\WooCommerce\Internal\OrderReviews

Endpoint::maybe_flush_pending_rewrite │ public │ WC 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. Installing requests and WP-CLI requests that skip the active theme leave the endpoint-specific queue intact for the next normal request, when the complete rewrite graph is available.

Метод класса: Endpoint{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Код Endpoint::maybe_flush_pending_rewrite() WC 11.2.2

public function maybe_flush_pending_rewrite(): void {
	if ( wp_installing() || $this->wp_cli_skips_active_theme() || 'yes' !== get_option( 'woocommerce_review_order_flush_rewrite_pending' ) ) {
		return;
	}

	flush_rewrite_rules( false );
	delete_option( 'woocommerce_review_order_flush_rewrite_pending' );
}