Ticket #6481: 6481.18.diff
File 6481.18.diff, 1.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
265 265 endif; 266 266 267 267 /** 268 * Enable pretty permalinks.268 * Maybe enable pretty permalinks on install. 269 269 * 270 270 * If after enabling pretty permalinks don't work, fallback to query-string permalinks. 271 271 * … … 272 272 * @since 4.2.0 273 273 * 274 274 * @global WP_Rewrite $wp_rewrite WordPress rewrite component. 275 * 276 * @return bool Whether pretty permalinks are enabled. False otherwise.√5 275 277 */ 276 278 function wp_install_maybe_enable_pretty_permalinks() { 277 279 global $wp_rewrite; … … 278 280 279 281 // Bail if a permalink structure is already enabled. 280 282 if ( get_option( 'permalink_structure' ) ) { 281 return ;283 return true; 282 284 } 283 285 284 286 /* … … 305 307 306 308 // Test against a real WordPress Post, or if none were created, a random 404 page. 307 309 $test_url = get_permalink( 1 ); 310 308 311 if ( ! $test_url ) { 309 312 $test_url = home_url( '/wordpress-check-for-rewrites/' ); 310 313 } … … 331 334 */ 332 335 $wp_rewrite->set_permalink_structure( '' ); 333 336 $wp_rewrite->flush_rules( true ); 337 338 return false; 334 339 } 335 340 336 341 if ( !function_exists('wp_new_blog_notification') ) :