Make WordPress Core

Ticket #30501: rewrite-wp-loaded.patch

File rewrite-wp-loaded.patch, 678 bytes (added by joostdevalk, 10 years ago)

Rewrite to wp-loaded patch (v3)

  • wp-includes/rewrite.php

     
    20412041         * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
    20422042         */
    20432043        public function flush_rules($hard = true) {
     2044                // Prevent this action from running before everyone has registered their rewrites
     2045                if ( ! did_action( 'wp_loaded' ) ) {
     2046                        add_action( 'wp_loaded', array( $this, 'flush_rules' ) );
     2047                        return;
     2048                }
     2049
    20442050                delete_option('rewrite_rules');
    20452051                $this->wp_rewrite_rules();
    20462052                /**