Ticket #12002: 12002.2.diff
File 12002.2.diff, 2.9 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/ms.php
603 603 add_action( 'network_admin_notices', 'site_admin_notice' ); 604 604 605 605 function avoid_blog_page_permalink_collision( $data, $postarr ) { 606 if ( is_subdomain_install() )606 if ( is_subdomain_install() || ! is_main_site() || empty( $data['post_name'] ) ) 607 607 return $data; 608 if ( $data['post_type'] != 'page' ) 608 609 $blog_prefix = apply_filters( 'ms_blog_prefix', '/blog' ); 610 611 if ( ! empty( $blog_prefix ) ) 609 612 return $data; 610 if ( !isset( $data['post_name'] ) || $data['post_name'] == '' ) 613 614 // Ignore it if the post type is not public 615 if ( ! in_array( $data['post_type'], get_post_types( array( 'public' => true ) ) ) ) 611 616 return $data; 612 if ( !is_main_site() )613 return $data;614 617 615 618 $post_name = $data['post_name']; 616 619 $c = 0; -
wp-admin/options-permalink.php
62 62 $prefix = $blog_prefix = ''; 63 63 if ( ! got_mod_rewrite() && ! $iis7_permalinks ) 64 64 $prefix = '/index.php'; 65 if ( is_multisite() && !is_subdomain_install() && is_main_site() ) 66 $blog_prefix = '/blog'; 65 if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { 66 $blog_prefix = apply_filters( 'ms_blog_prefix', '/blog' ); 67 if ( ! empty( $blog_prefix ) && '/' != $blog_prefix[0] ) 68 $blog_prefix = '/' . $blog_prefix; 69 } 67 70 68 71 if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { 69 72 check_admin_referer('update-permalink'); … … 158 161 <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> 159 162 160 163 <?php 161 if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { 162 $permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure ); 163 $category_base = preg_replace( '|^/?blog|', '', $category_base ); 164 $tag_base = preg_replace( '|^/?blog|', '', $tag_base ); 164 if ( is_multisite() && !is_subdomain_install() && is_main_site() && !empty( $blog_prefix ) ) { 165 $blog_prefix_base = '|^/?' . substr( $blog_prefix, 1 ) . '|'; 166 167 $permalink_structure = preg_replace( $blog_prefix_base, '', $permalink_structure ); 168 $category_base = preg_replace( $blog_prefix_base, '', $category_base ); 169 $tag_base = preg_replace( $blog_prefix_base, '', $tag_base ); 165 170 } 166 171 167 172 $structures = array(