Ticket #6481: 6481.3.diff
File 6481.3.diff, 2.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/schema.php
397 397 'links_updated_date_format' => __('F j, Y g:i a'), 398 398 'comment_moderation' => 0, 399 399 'moderation_notify' => 1, 400 'permalink_structure' => ' ',400 'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/', 401 401 'gzipcompression' => 0, 402 402 'hack_file' => 0, 403 403 'blog_charset' => 'UTF-8', … … 495 495 if ( is_multisite() ) { 496 496 /* translators: blog tagline */ 497 497 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), get_current_site()->site_name ); 498 $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';499 498 } 500 499 501 500 // Set autoload to no for these options -
src/wp-admin/includes/upgrade.php
241 241 elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) ) 242 242 update_user_meta( $user_id, 'show_welcome_panel', 2 ); 243 243 244 if ( ! is_multisite() ) { 245 // Verify pretty permalinks work, falling back to ugly permalinks if they don't. 246 $pretty_permalinks_work = wp_install_verify_permalink_structure(); 247 if ( ! $pretty_permalinks_work ) { 248 $wp_rewrite->set_permalink_structure(''); 249 $wp_rewrite->flush_rules(); 250 } 251 } 252 244 253 if ( is_multisite() ) { 245 254 // Flush rules to pick up the new page. 246 255 $wp_rewrite->init(); … … 260 269 } 261 270 endif; 262 271 272 /** 273 * Verify whether the default pretty permalink structure works. 274 * 275 * @since 4.1.0 276 * 277 * @return bool 278 */ 279 function wp_install_verify_permalink_structure() { 280 global $wp_rewrite; 281 // Flush rules with the hard option to force refresh of the web-server's 282 // rewrite config file (e.g. .htaccess or web.config). 283 $wp_rewrite->flush_rules( true ); 284 285 // Send a HEAD request to the dummy post made in wp_install_defaults() 286 // to smoke test pretty permalinks. 287 $link = get_permalink(1); 288 $response = wp_remote_head( $link ); 289 290 $good_response = is_array( $response ) && isset( $response['response'], $response['response']['code'] ) 291 && $response['response']['code'] == 200; 292 293 return $good_response; 294 } 295 263 296 if ( !function_exists('wp_new_blog_notification') ) : 264 297 /** 265 298 * {@internal Missing Short Description}}