Opened 9 years ago
Closed 9 years ago
#41507 closed enhancement (fixed)
Replace $wpdb->siteid with get_current_network_id()
| Reported by: | spacedmonkey | Owned by: | sathyapulse |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Networks and Sites | Version: | 4.6 |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: | multisite |
Description
The helper function get_current_network_id() was introduced in 4.6. It is already used in a number of places, however there was still references to $wpdb->siteid throughout the core.
Attachments (4)
Change History (16)
#3
@
9 years ago
@spacedmonkey I have attached the patch file with the ticket which addresses the replace of $wpdb->siteid with get_current_network_id() in the functions mentioned. Additionally I found the usage in the function wp_load_core_site_options and replaced it. Could you please check the patch and let me know your thoughts?
#5
@
9 years ago
@sathyapulse Great work.
Couple of things. Can you make sure to remove the global $wpdb references and update the docs.
There are also 7 references in the phpunit tests to $wpdb->siteid that should be replaced.
#6
@
9 years ago
@spacedmonkey I have created a new patch file by removing the global references. I am not sure about the changes in the phpunit tests. It's mostly in the assignment. Could you please be clear what needs to be removed? All the 7 occurrences?
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
9 years ago
#10
@
9 years ago
41507.2.diff removes references to $wpdb->siteid in test. This basically means it is deprecated and is not used for anything.
@flixos90 what are your thoughts on officially deprecating it at some point.
#11
@
9 years ago
- Keywords commit added
41507.3.diff ensures that it applies cleanly after the changes made in [41241]. It furthermore removes the hacky network switching logic from the unit tests completely, since that is no longer necessary as wp_update_network_site_counts() and wp_update_network_user_counts() now accept the $network_id as parameter.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Usage in
Less important as deprecated