woocommerce_flush_rewrite_rules action-hookWC 2.7.0

Flush the rewrite rules after install or update.

Usage

add_action( 'woocommerce_flush_rewrite_rules', 'wp_kama_woocommerce_flush_rewrite_rules_action' );

/**
 * Function for `woocommerce_flush_rewrite_rules` action-hook.
 * 
 * @return void
 */
function wp_kama_woocommerce_flush_rewrite_rules_action(){

	// action...
}

Changelog

Since 2.7.0 Introduced.

Where the hook is called

WC_Install::install()
woocommerce_flush_rewrite_rules
flush_rewrite_rules_on_shop_page_save()
woocommerce_flush_rewrite_rules
woocommerce/includes/class-wc-install.php 473
do_action( 'woocommerce_flush_rewrite_rules' );
woocommerce/includes/wc-core-functions.php 1174
do_action( 'woocommerce_flush_rewrite_rules' );

Where the hook is used in WooCommerce

woocommerce/includes/class-wc-post-types.php 31
add_action( 'woocommerce_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) );