flush_rewrite_rules_on_shop_page_save

Flushes rewrite rules when the shop page (or it's children) gets saved.

Description

flush_rewrite_rules_on_shop_page_save( $post_id ); 

Parameters (1)

0. $post_id
The post id.

Usage

  1. if ( !function_exists( 'flush_rewrite_rules_on_shop_page_save' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // The post id. 
  5. $post_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = flush_rewrite_rules_on_shop_page_save($post_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-core-functions.php  
  1. function flush_rewrite_rules_on_shop_page_save( $post_id ) { 
  2. $shop_page_id = wc_get_page_id( 'shop' ); 
  3. if ( $shop_page_id === $post_id || in_array( $post_id, wc_get_page_children( $shop_page_id ) ) ) {