Make WordPress Core

Opened 5 years ago

#48901 new enhancement

WordPress multisite with subdirectories sites using the same 'Site Title'

Reported by: simpleform's profile simpleform Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

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
        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

    $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>';
                }
                

Change History (0)

Note: See TracTickets for help on using tickets.