Make WordPress Core

Ticket #11384: 11384.diff

File 11384.diff, 1.2 KB (added by Denis-de-Bernardy, 15 years ago)
  • wp-includes/rewrite.php

     
    16061606         * @since 1.5.0
    16071607         * @access public
    16081608         *
     1609         * @param boolean $refresh whether to force a refresh or not (used by flush_rules())
    16091610         * @return array Rewrite rules.
    16101611         */
    1611         function wp_rewrite_rules() {
    1612                 $this->rules = get_option('rewrite_rules');
     1612        function wp_rewrite_rules($refresh = false) {
     1613                $this->rules = $refresh ? false : get_option('rewrite_rules');
    16131614                if ( empty($this->rules) ) {
    16141615                        $this->matches = 'matches';
    16151616                        $this->rewrite_rules();
     
    18451846         * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
    18461847         */
    18471848        function flush_rules($hard = true) {
    1848                 delete_option('rewrite_rules');
    1849                 $this->wp_rewrite_rules();
     1849                if ( $hard )
     1850                        delete_option('rewrite_rules');
     1851                $this->wp_rewrite_rules(true);
    18501852                if ( $hard && function_exists('save_mod_rewrite_rules') )
    18511853                        save_mod_rewrite_rules();
    18521854                if ( $hard && function_exists('iis7_save_url_rewrite_rules') )