[wp-trac] [WordPress Trac] #48786: Wrong URLs to categories, authors etc. to a site in a multisite

WordPress Trac noreply at wordpress.org
Wed Mar 15 15:20:55 UTC 2023


#48786: Wrong URLs to categories, authors etc. to a site in a multisite
--------------------------+------------------------------
 Reporter:  Hinjiriyo     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Permalinks    |     Version:  5.3
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  multisite
--------------------------+------------------------------

Comment (by timholz):

 I encounter the same mix-up for the category base:

 {{{
 if (is_archive() && !is_tag()){
     switch_to_blog($myblog_id );
     //get current category id
     $category = get_category( get_query_var( 'cat' ) );
     $cat_id = $category->cat_ID;
     //get category link of switched blog
     $url_cat = get_category_link($cat_id);
     echo $url_cat;
     restore_current_blog();
 }
 }}}

 The echo for $myblog_id = 1 is:

 {{{
 http://localhost/es/stichwort/carbon/ //should be palabra-clave
 }}}

 The echo for $myblog_id = 2 is:

 {{{
 http://localhost/palabra-clave/kohle/ //should be stichwort
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48786#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list