Make WordPress Core

Changeset 32027


Ignore:
Timestamp:
04/05/2015 02:48:23 PM (10 years ago)
Author:
SergeyBiryukov
Message:

wp_install_maybe_enable_pretty_permalinks() should have a consistent @return value.

props DrewAPicture.
fixes #6481. see #31888.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r31358 r32027  
    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.
     
    273273 *
    274274 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
     275 *
     276 * @return bool Whether pretty permalinks are enabled. False otherwise.
    275277 */
    276278function wp_install_maybe_enable_pretty_permalinks() {
     
    279281    // Bail if a permalink structure is already enabled.
    280282    if ( get_option( 'permalink_structure' ) ) {
    281         return;
     283        return true;
    282284    }
    283285
     
    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/' );
     
    332335    $wp_rewrite->set_permalink_structure( '' );
    333336    $wp_rewrite->flush_rules( true );
     337
     338    return false;
    334339}
    335340
Note: See TracChangeset for help on using the changeset viewer.