[wp-trac] [WordPress Trac] #48901: WordPress multisite with subdirectories sites using the same 'Site Title'

WordPress Trac noreply at wordpress.org
Fri Dec 6 10:32:25 UTC 2019


#48901: WordPress multisite with subdirectories sites using the same 'Site Title'
--------------------------------+-----------------------------
 Reporter:  simpleform          |      Owner:  (none)
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  5.3
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 I want to create a WordPress multisite with subdirectories sites using the
 same 'Site Title'.
 I’ll be implementing an English version, Italian version, Spanish version,
 and so on.
 The URL will be:
 mysite.com
 mysite.com/it
 mysite.com/es

 By clicking on 'My Sites', the sites list on the My Sites screen will show
 the same name. A change in the file my-sites.php may resolve this annoying
 problem

 Instead of:


 {{{#!php
 <?php
         foreach ( $blogs as $user_blog ) {
                 switch_to_blog( $user_blog->userblog_id );

                 echo '<li>';
                 echo "<h3>{$user_blog->blogname}</h3>";

                 $actions = "<a href='" . esc_url( home_url() ) . "'>" .
 __( 'Visit' ) . '</a>';

                 if ( current_user_can( 'read' ) ) {
                         $actions .= " | <a href='" . esc_url( admin_url()
 ) . "'>" . __( 'Dashboard' ) . '</a>';
                 }
 ?>
 }}}

 Would it possible to change as described below ?

 {{{#!php
 <?php

     $site_name = array_unique(array_column($blogs, 'blogname'));

         foreach ( $blogs as $user_blog ) {
                 switch_to_blog( $user_blog->userblog_id );

                 echo '<li>';
                 if ( count($site_name) == 1 ):
                 echo "<h3>{$user_blog->siteurl}</h3>";
                 else:
                 echo "<h3>{$user_blog->blogname}</h3>";
                 endif;

                 $actions = "<a href='" . esc_url( home_url() ) . "'>" .
 __( 'Visit' ) . '</a>';

                 if ( current_user_can( 'read' ) ) {
                         $actions .= " | <a href='" . esc_url( admin_url()
 ) . "'>" . __( 'Dashboard' ) . '</a>';
                 }

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48901>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list