[wp-trac] [WordPress Trac] #40623: Investigate new file structure for Multisite functionality

WordPress Trac noreply at wordpress.org
Mon May 1 18:21:59 UTC 2017


#40623: Investigate new file structure for Multisite functionality
--------------------------------+------------------------------
 Reporter:  flixos90            |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  multisite
--------------------------------+------------------------------

Comment (by flixos90):

 After playing around with the loading order, I already have to revert my
 initial idea: Loading the files after all the rest is not a great idea
 since some areas require the current site and network to be set up prior.

 However we could move the three files that are loaded late into the
 initial block. That would already provide some benefits, for example
 deprecated functions that were previously available in `ms-blogs.php` and
 have been moved to `ms-deprecated.php` should still be available early,
 and by that tweak they would be.

 I encountered a further problem: Some functions in `ms-blogs.php` assume
 that the current site and network area already set up. However, those
 functions can be called prior to that (for example in a custom
 `sunrise.php`), and they should properly handle the case that `null` is
 returned by `get_site()` or `get_network()`. There is an `ms-loaded` hook
 in `ms-settings.php` that we could use to easily check whether the
 multisite bootstrap process has already been completed.
 An alternative would be to think about a file structure, where we only
 make a selected list of functions available early (before `ms-
 settings.php`) and move the rest to a later loading point, however this
 might become very complicated for BC because people might have been using
 some of these "not-recommended" functions.

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


More information about the wp-trac mailing list