Automattic\WooCommerce\Internal\OrderReviews

Endpoint::queue_pending_rewrite_flush │ private │ WC 1.0

Queue the endpoint-specific soft flush for maybe_flush_pending_rewrite().

While WordPress is installing, update_option() the row but skips every cache update, so a persistent object cache keeps serving the previous value and the next request never sees the queued flush. Evict both places the option can be cached, mirroring WC_Post_Types::flush_rewrite_rules().

Method of the class: Endpoint{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->queue_pending_rewrite_flush(): void;

Endpoint::queue_pending_rewrite_flush() code WC 11.3.0

private function queue_pending_rewrite_flush(): void {
	update_option( 'woocommerce_review_order_flush_rewrite_pending', 'yes' );

	if ( wp_installing() ) {
		wp_cache_delete( 'woocommerce_review_order_flush_rewrite_pending', 'options' );
		wp_cache_delete( 'alloptions', 'options' );
	}
}