Ticket #11384: 11384.diff
File 11384.diff, 1.2 KB (added by , 15 years ago) |
---|
-
wp-includes/rewrite.php
1606 1606 * @since 1.5.0 1607 1607 * @access public 1608 1608 * 1609 * @param boolean $refresh whether to force a refresh or not (used by flush_rules()) 1609 1610 * @return array Rewrite rules. 1610 1611 */ 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'); 1613 1614 if ( empty($this->rules) ) { 1614 1615 $this->matches = 'matches'; 1615 1616 $this->rewrite_rules(); … … 1845 1846 * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). 1846 1847 */ 1847 1848 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); 1850 1852 if ( $hard && function_exists('save_mod_rewrite_rules') ) 1851 1853 save_mod_rewrite_rules(); 1852 1854 if ( $hard && function_exists('iis7_save_url_rewrite_rules') )