Defer flush so CPT is updated before flush.

Fixes #12787
This commit is contained in:
Mike Jolley 2017-01-11 16:12:00 +00:00
parent fff98a9fbd
commit 748db4e675
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ class WC_Admin_Settings {
delete_transient( 'woocommerce_cache_excluded_uris' );
WC()->query->init_query_vars();
WC()->query->add_endpoints();
do_action( 'woocommerce_flush_rewrite_rules' );
wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );
do_action( 'woocommerce_settings_saved' );
}