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.8.1

do_action('woocommerce_flush_rewrite_rules') is found 2 times:

  • /includes/class-wc-install.php line 508
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    * 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 1196
    1192
    1193
    1194
    1195
    1196
    1197
    1198
    1199
    1200
    1201
    1202
        $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: