[wp-trac] [WordPress Trac] #21156: Move utility functions out of wp-admin/network.php
WordPress Trac
noreply at wordpress.org
Tue Aug 13 19:11:27 UTC 2013
#21156: Move utility functions out of wp-admin/network.php
-------------------------+------------------
Reporter: scribu | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.7
Component: Multisite | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------
Comment (by nacin):
admin/includes/ms.php only gets included when multisite is enabled. As
network.php is for converting to a network, ms.php cannot be relied upon.
Including ms.php and allowing code from it to be executed before multisite
is loaded could have nasty side effects.
I imagine scribu wants these functions specifically for WP-CLI, which is
totally understandable. Beyond that, though, I'd really hesitate to make
too much of network creation truly public, because most of these functions
are either based on our rudimentary UI and upgrade process, or on our
current subdirectory/subdomain restrictions. Long term, both get dropped.
populate_network() already exists, which is sufficient for most use cases.
To satisfy WP-CLI's needs, I'd suggest pushing these functions to be
usable with a few changes:
* Renaming network_domain_check() and having it return `*`. Maybe
`ms_is_network_installed()`
* Probably finding a better name for get_clean_basedomain().
Definitely fine with allow_subdirectory_install() and
allow_subdomain_install() to be public. Note they'll likely just `return;`
or `return true;` at some later point when subdomain versus subdirectory
goes away.
No need for the @var's, we don't really do those on reference, just
initial defines. It'd also be @global anyway.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21156#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list