Automattic\WooCommerce\Internal\Ucp

UcpDiscovery::maybe_flush_rewrite_rules │ public │ WC 1.0

Queue a rewrite rules flush when the UCP feature is toggled.

Method of the class: UcpDiscovery{}

No Hooks.

Returns

null. Nothing (null).

Usage

$UcpDiscovery = new UcpDiscovery();
$UcpDiscovery->maybe_flush_rewrite_rules( $feature_id ): void;
$feature_id(string) (required)
Feature being toggled.

UcpDiscovery::maybe_flush_rewrite_rules() code WC 11.3.0

public function maybe_flush_rewrite_rules( string $feature_id ): void {
	if ( UcpUtils::FEATURE_ID === $feature_id ) {
		update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
	}
}