WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/26/2010 11:02:49 PM (11 years ago)
Author:
wpmuguru
Message:

Change options-permalinks to use is_main_site(), fix /blog offset display, See #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r12789 r12860  
    8383        if (! empty($permalink_structure) )
    8484            $permalink_structure = preg_replace('#/+#', '/', '/' . $_POST['permalink_structure']);
    85         if ( is_multisite() && !is_subdomain_install()  && $permalink_structure != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) {
     85        if ( is_multisite() && !is_subdomain_install()  && $permalink_structure != '' && is_main_site() ) {
    8686            $permalink_structure = '/blog' . $permalink_structure;
    8787        }
     
    9393        if (! empty($category_base) )
    9494            $category_base = preg_replace('#/+#', '/', '/' . $_POST['category_base']);
    95         if ( is_multisite() && !is_subdomain_install() && $category_base != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) {
     95        if ( is_multisite() && !is_subdomain_install() && $category_base != '' && is_main_site() ) {
    9696            $category_base = '/blog' . $category_base;
    9797        }
     
    103103        if (! empty($tag_base) )
    104104            $tag_base = preg_replace('#/+#', '/', '/' . $_POST['tag_base']);
    105         if ( is_multisite() && !is_subdomain_install() && $tag_base != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) {
     105        if ( is_multisite() && !is_subdomain_install() && $tag_base != '' && is_main_site() ) {
    106106            $tag_base = '/blog' . $tag_base;
    107107        }
     
    204204        </th>
    205205        <td>
    206             <?php if ( is_multisite() && !is_subdomain_install() && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $permalink_structure = str_replace( "/blog", "", $permalink_structure ); }?>
     206            <?php if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { echo "/blog"; $permalink_structure = preg_replace( "|/?blog|", "", $permalink_structure ); }?>
    207207            <input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr($permalink_structure); ?>" class="regular-text code" />
    208208        </td>
     
    220220    <tr>
    221221        <th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e('Category base'); ?></label></th>
    222         <td><?php if ( is_multisite() && !is_subdomain_install() && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
     222        <td><?php if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { echo "/blog"; $category_base = preg_replace( "|^/?blog|", "", $category_base ); }?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
    223223    </tr>
    224224    <tr>
    225225        <th><label for="tag_base"><?php _e('Tag base'); ?></label></th>
    226         <td><?php if ( is_multisite() && !is_subdomain_install() && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $tag_base = str_replace( "/blog", "", $tag_base ); }?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr($tag_base); ?>" class="regular-text code" /></td>
     226        <td><?php if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { echo "/blog"; $tag_base = preg_replace( "|/?blog|", "", $tag_base ); }?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr($tag_base); ?>" class="regular-text code" /></td>
    227227    </tr>
    228228    <?php do_settings_fields('permalink', 'optional'); ?>
Note: See TracChangeset for help on using the changeset viewer.