Make WordPress Core

Ticket #37892: 37892.patch

File 37892.patch, 508 bytes (added by Chouby, 8 years ago)
  • wp-includes/class-wp-rewrite.php

    diff --git wp-includes/class-wp-rewrite.php wp-includes/class-wp-rewrite.php
    index 2c57615..469a9df 100644
    class WP_Rewrite { 
    14751475                if ( empty($this->rules) ) {
    14761476                        $this->matches = 'matches';
    14771477                        $this->rewrite_rules();
     1478                        if ( ! did_action( 'wp_loaded' ) ) {
     1479                                add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
     1480                                return $this->rules;
     1481                        }
    14781482                        update_option('rewrite_rules', $this->rules);
    14791483                }
    14801484