[wp-trac] [WordPress Trac] #21077: Add support for custom ports in multisite site addresses

WordPress Trac noreply at wordpress.org
Tue Sep 12 19:42:44 UTC 2023


#21077: Add support for custom ports in multisite site addresses
----------------------------------------+-----------------------------
 Reporter:  djzone                      |       Owner:  (none)
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  Future Release
Component:  Bootstrap/Load              |     Version:  3.4
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:  multisite
----------------------------------------+-----------------------------

Comment (by Jules Colle):

 My multisite network is running on `localhost:8082`. Everything seems to
 be working fine for now with this code:

 {{{#!php
 <?php
 add_filter( 'wp_normalize_site_data', function( $data ) {
     $data['domain'] = str_replace('8082', ':8082', $data['domain']);
     return $data;
 }, 50, 1 );
 }}}

 I've added this in mu-plugins, but I guess it can go in your theme's
 `functions.php` or a regular plugin as well.

 I can create sites trough wp-admin or via `wpmu_create_blog()` without any
 problems.

 Note that if your domain is called domain8082.com or something similar,
 this code will not work :)

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


More information about the wp-trac mailing list