[wp-trac] [WordPress Trac] #38699: Site count incorrect when using wpmu_create_blog() from a different network
WordPress Trac
noreply at wordpress.org
Mon Nov 7 22:55:50 UTC 2016
#38699: Site count incorrect when using wpmu_create_blog() from a different network
--------------------------------+-----------------------------
Reporter: johnjamesjacoby | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 3.0
Severity: normal | Keywords: 2nd-opinion
Focuses: multisite |
--------------------------------+-----------------------------
When using `wpmu_create_blog()` to create a site on a network ID other
than the current, both networks end up with incorrect site counts. The
current network gets +1, the other network ID remains the same.
In the event this site is the first site in a new network, no site or user
counts are saved in `wp_sitemeta`.
This is because of a fleet of functions that do not accept a network ID a
a parameter. It's also due to a lack of a network "switching" API to flip
the `$current_site` global around when calling them.
The following functions lack proper Network attribution:
* `wp_maybe_update_network_site_counts()`
* `wp_maybe_update_network_user_counts()`
* `wp_update_network_counts()`
* `wp_update_network_user_counts()`
* `wp_update_network_site_counts()`
See: #37538.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38699>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list