Ticket #29107: 29107.diff
| File 29107.diff, 1.7 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/includes/schema.php
398 398 'comment_moderation' => 0, 399 399 'moderation_notify' => 1, 400 400 'permalink_structure' => '', 401 'rewrite_rules' => '', 401 402 'gzipcompression' => 0, 402 403 'hack_file' => 0, 403 404 'blog_charset' => 'UTF-8', -
src/wp-includes/rewrite.php
2043 2043 * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). 2044 2044 */ 2045 2045 public function flush_rules($hard = true) { 2046 delete_option('rewrite_rules');2046 update_option( 'rewrite_rules', '' ); 2047 2047 $this->wp_rewrite_rules(); 2048 2048 /** 2049 2049 * Filter whether a "hard" rewrite rule flush should be performed when requested. -
tests/phpunit/tests/rewrite.php
120 120 121 121 restore_current_blog(); 122 122 } 123 } 124 No newline at end of file 123 124 /* 125 * @ticket 29107 126 */ 127 function test_function_rules_option_noempty() { 128 global $wp_rewrite; 129 130 $wp_rewrite->set_permalink_structure( '' ); 131 $wp_rewrite->flush_rules(); 132 $wp_rewrite->set_permalink_structure( '/%postname%/' ); 133 $wp_rewrite->flush_rules(); 134 135 $rewrite_rules = get_option( 'rewrite_rules' ); 136 137 $this->assertTrue( is_array( $rewrite_rules ) ); 138 $this->assertNotEmpty( $rewrite_rules ); 139 } 140 }