WordPress.org

Make WordPress Core

Ticket #6481: 6481.18.diff

File 6481.18.diff, 1.2 KB (added by DrewAPicture, 5 years ago)
  • src/wp-admin/includes/upgrade.php

     
    265265endif;
    266266
    267267/**
    268  * Enable pretty permalinks.
     268 * Maybe enable pretty permalinks on install.
    269269 *
    270270 * If after enabling pretty permalinks don't work, fallback to query-string permalinks.
    271271 *
     
    272272 * @since 4.2.0
    273273 *
    274274 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
     275 *
     276 * @return bool Whether pretty permalinks are enabled. False otherwise.√5
    275277 */
    276278function wp_install_maybe_enable_pretty_permalinks() {
    277279        global $wp_rewrite;
     
    278280
    279281        // Bail if a permalink structure is already enabled.
    280282        if ( get_option( 'permalink_structure' ) ) {
    281                 return;
     283                return true;
    282284        }
    283285
    284286        /*
     
    305307
    306308                // Test against a real WordPress Post, or if none were created, a random 404 page.
    307309                $test_url = get_permalink( 1 );
     310
    308311                if ( ! $test_url ) {
    309312                        $test_url = home_url( '/wordpress-check-for-rewrites/' );
    310313                }
     
    331334         */
    332335        $wp_rewrite->set_permalink_structure( '' );
    333336        $wp_rewrite->flush_rules( true );
     337
     338        return false;
    334339}
    335340
    336341if ( !function_exists('wp_new_blog_notification') ) :