Make WordPress Core

Ticket #30501: 30501.2.patch

File 30501.2.patch, 972 bytes (added by DrewAPicture, 9 years ago)

spacing

  • src/wp-includes/rewrite.php

     
    20452045         * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
    20462046         */
    20472047        public function flush_rules($hard = true) {
     2048               
     2049                static $do_hard_later;
     2050
    20482051                // Prevent this action from running before everyone has registered their rewrites
    20492052                if ( ! did_action( 'wp_loaded' ) ) {
    20502053                        add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
     2054                        $do_hard_later = $hard;
    20512055                        return;
     2056                } elseif ( isset( $do_hard_later ) && doing_action( 'wp_loaded' ) ) {
     2057                        $hard = $do_hard_later;
     2058                        $do_hard_later = null;
    20522059                }
    20532060
    20542061                delete_option('rewrite_rules');
    20552062                $this->wp_rewrite_rules();
     2063
    20562064                /**
    20572065                 * Filter whether a "hard" rewrite rule flush should be performed when requested.
    20582066                 *