#41806 closed enhancement (fixed)
Use get_network_by_path in get_admin_users_for_domain
| Reported by: | spacedmonkey | Owned by: | jeremyfelt |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Networks and Sites | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch close |
| Cc: | Focuses: | multisite |
Description
To save doing a raw SQL query to site table, use get_network_by_path instead in get_admin_users_for_domain
Attachments (2)
Change History (7)
#2
@
9 years ago
- Keywords close added
I'd prefer ignoring it. We shouldn't spend much time maintaining deprecated functions unless there's a noticeable benefit. Also, WP_Network::get_by_path() and get_network_by_path() are intended for bootstrap use. For something like this, I think a straight get_networks() would make more sense. I'm going to suggest we close this as a wontfix.
#3
@
9 years ago
@jeremyfelt The reason for the patch is simple, there are only 2 other places in core that run raw sql queries on the sites table. I already for a patch for ms_load_current_site_and_network (#41762) and it is pointless change network_domain_check as it only used installation process.
For the sake of completely and the simply nature of this patch, I would make the change.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the patch @spacedmonkey! The patch itself looks fine, however the function is deprecated and I'm not sure how much effort should go into those regarding enhancements that go beyond bugfixes.
@jeremyfelt Any best practices for this kind of stuff? Should we just commit it as long as it's as simple as this or ignore since the function is deprecated?