diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 98791f6dde..0d38db7075 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -2036,6 +2036,12 @@ class WP_Rewrite { * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). */ public function flush_rules($hard = true) { + // Prevent this action from running before everyone has registered their rewrites + if ( ! did_action( 'wp_loaded' ) ) { + add_action( 'wp_loaded', array( $this, 'flush_rules' ) ); + return; + } + delete_option('rewrite_rules'); $this->wp_rewrite_rules(); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4cffb20193..d5f35882c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31103'; +$wp_version = '4.2-alpha-31104'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.