WordPress.org

Make WordPress Core

Changeset 14884


Ignore:
Timestamp:
05/25/2010 03:16:31 PM (11 years ago)
Author:
nacin
Message:

Improved mayday calls in network.php when a subdirectory install isn't allowed. Also, /allow_folder_install/allow_subdirectory_install/g. fixes #12884, fixes #12931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network.php

    r14871 r14884  
    5151}
    5252/**
    53  * Allow folder install
    54  *
    55  * @since 3.0.0
    56  * @return bool Whether folder install is allowed
    57  */
    58 function allow_folder_install() {
     53 * Allow subdirectory install
     54 *
     55 * @since 3.0.0
     56 * @return bool Whether subdirectory install is allowed
     57 */
     58function allow_subdirectory_install() {
    5959    global $wpdb;
    60     if ( apply_filters( 'allow_folder_install', false ) )
     60    if ( apply_filters( 'allow_subdirectory_install', false ) )
    6161        return true;
    6262
     
    162162    } elseif ( apache_mod_loaded('mod_rewrite') ) { // assume nothing
    163163        $subdomain_install = true;
    164     } elseif ( !allow_folder_install() ) {
     164    } elseif ( !allow_subdirectory_install() ) {
    165165        $subdomain_install = true;
    166166    } else {
     
    173173    }
    174174
    175     if ( allow_subdomain_install() && allow_folder_install() ) : ?>
     175    if ( allow_subdomain_install() && allow_subdirectory_install() ) : ?>
    176176        <h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3>
    177177        <p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. <strong>You cannot change this later.</strong>' ); ?></p>
     
    212212            <tr>
    213213                <th scope="row"><?php esc_html_e( 'Sub-directory Install' ); ?></th>
    214                 <td><?php _e( 'Because you are using <code>localhost</code>, the sites in your WordPress network must use sub-directories. Consider using <code>localhost.localdomain</code> if you wish to use sub-domains.' ); ?></td>
     214                <td><?php
     215                    _e( 'Because you are using <code>localhost</code>, the sites in your WordPress network must use sub-directories. Consider using <code>localhost.localdomain</code> if you wish to use sub-domains.' );
     216                    // Uh oh:
     217                    if ( !allow_subdirectory_install() )
     218                        echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
     219                ?></td>
    215220            </tr>
    216221        <?php elseif ( !allow_subdomain_install() ) : ?>
    217222            <tr>
    218223                <th scope="row"><?php esc_html_e( 'Sub-directory Install' ); ?></th>
    219                 <td><?php _e( 'Because your install is in a directory, the sites in your WordPress network must use sub-directories.' ); ?></td>
    220             </tr>
    221         <?php elseif ( !allow_folder_install() ) : ?>
     224                <td><?php
     225                    _e( 'Because your install is in a directory, the sites in your WordPress network must use sub-directories.' );
     226                    // Uh oh:
     227                    if ( !allow_subdirectory_install() )
     228                        echo ' <strong>' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';   
     229                ?></td>
     230            </tr>
     231        <?php elseif ( !allow_subdirectory_install() ) : ?>
    222232            <tr>
    223233                <th scope="row"><?php esc_html_e( 'Sub-domain Install' ); ?></th>
    224                 <td><?php _e( 'Because your install is over 1 month old, the sites in your WordPress network must use sub-domains.' ); ?></td>
     234                <td><?php _e( 'Because your install is not new, the sites in your WordPress network must use sub-domains.' );
     235                    echo ' <strong>' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . '</strong>';
     236                ?></td>
    225237            </tr>
    226238        <?php endif; ?>
     
    267279
    268280    if ( $_POST ) {
    269         $subdomain_install = allow_subdomain_install() ? ( allow_folder_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false;
     281        $subdomain_install = allow_subdomain_install() ? ( allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false;
    270282    } else {
    271283        if ( is_multisite() ) {
Note: See TracChangeset for help on using the changeset viewer.