[wp-trac] [WordPress Trac] #30233: Replace or rewrite domain_exists() for more accurate usage

WordPress Trac noreply at wordpress.org
Sun Nov 2 01:47:26 UTC 2014


#30233: Replace or rewrite domain_exists() for more accurate usage
--------------------------------+-----------------------------
 Reporter:  jeremyfelt          |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  3.0
 Severity:  normal              |   Keywords:  dev-feedback
  Focuses:  multisite           |
--------------------------------+-----------------------------
 `domain_exists()` was added in
 [https://mu.trac.wordpress.org/changeset/543 MU:543] in almost its current
 form. The enforcement of trailing slashes on paths was added in #20589 and
 a filter was added in #21442.

 A few notes:

 * The lookup for a domain and path combination is restricted to one
 network. This allows the same domain and path combination to be used on
 multiple networks, which should not be default behavior.
 * The name, `domain_exists()`, implies a check for domain. It is really
 checking for a full site URL.
 * While it is entirely possible to ignore the result by providing your own
 in the filter, it would be nice to not always require this for multi-
 network configurations.

 My **guess** is that the original intent was to ensure a subdomain or path
 was not present when creating a site on an open network.

 In thinking of how to address this, these two possibilities came to mind.

 * Deprecate `domain_exists()` and wrap a new function that does a larger
 check. `wp_get_site()` could work alongside `wp_get_sites()` and support
 domain/path lookup.
 * Allow the current `$site_id` argument to be `null` (for all), or an
 array (for many), in addition to the current `int` expectation.

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


More information about the wp-trac mailing list