WC_Post_Types::maybe_flush_rewrite_rules()public staticWC 3.3.0

Flush rules if the event is queued.

Method of the class: WC_Post_Types{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Post_Types::maybe_flush_rewrite_rules();

Changelog

Since 3.3.0 Introduced.

WC_Post_Types::maybe_flush_rewrite_rules() code WC 8.7.0

public static function maybe_flush_rewrite_rules() {
	if ( 'yes' === get_option( 'woocommerce_queue_flush_rewrite_rules' ) ) {
		update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
		self::flush_rewrite_rules();
	}
}