woocommerce_flush_rewrite_rules

woocommerce_flush_rewrite_rules

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_flush_rewrite_rules') is found 2 times:

  • /includes/class-wc-install.php line 501
    		 * Flush the rewrite rules after install or update.
    		 *
    		 * @since 2.7.0
    		 */
    		do_action( 'woocommerce_flush_rewrite_rules' );
    		/**
    		 * Run after WooCommerce has been installed or updated.
    		 *
    		 * @since 3.2.0
    		 */
    		do_action( 'woocommerce_installed' );
    
  • /includes/wc-core-functions.php line 1195
    	$post_id      = intval( $_GET['post'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    	$shop_page_id = wc_get_page_id( 'shop' );
    
    	if ( $shop_page_id === $post_id || in_array( $post_id, wc_get_page_children( $shop_page_id ), true ) ) {
    		do_action( 'woocommerce_flush_rewrite_rules' );
    	}
    }
    add_action( 'admin_footer', 'flush_rewrite_rules_on_shop_page_save' );
    
    /**
     * Various rewrite rule fixes.
    

See this hook used in plugins: