#51333 closed defect (bug) (fixed)
Assign 'sites_pre_query' and 'networks_pre_query' filter results to the class property
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | good-first-bug has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
Background: #45749, #47599, #50521.
[48990] assigns the array of comment data returned from the comments_pre_query
filter to the comments
property of the current WP_Comment_Query
instance.
As noted by @spacedmonkey in comment:2:ticket:50521, since networks_pre_query
and sites_pre_query
follow the same pattern, the same should be done for them:
- The array of network data returned from
networks_pre_query
should be assigned to thenetworks
property of the currentWP_Network_Query
instance. - The array of site data returned from
sites_pre_query
should be assigned to thesites
property of the currentWP_Site_Query
instance.
Change History (8)
This ticket was mentioned in PR #544 on WordPress/wordpress-develop by yakimun.
4 years ago
#1
- Keywords has-patch has-unit-tests added; needs-patch removed
This ticket was mentioned in PR #545 on WordPress/wordpress-develop by campusboy87.
4 years ago
#2
Added a check for the existence of a user, since the function can get the ID of the user (for example, the author of the page) that was deleted.
Trac ticket: https://core.trac.wordpress.org/ticket/51333
#4
@
4 years ago
For reference, just noting that the second PR here was accidental and is actually from #51370.
dream-encode commented on PR #545:
4 years ago
#5
Merged into WP Core in https://core.trac.wordpress.org/changeset/49036
#7
@
4 years ago
Hi @yakimun, just wanted to say thanks for the PR, it is quite accurate and does exactly what's needed.
It even has an added bonus of reusing the existing fixtures instead of creating new ones, which is something I did not initially think of, but is the right thing to do here.
Great job :)
SergeyBiryukov commented on PR #544:
4 years ago
#8
Merged in 31831c7.
Thanks for the patch @yakimun, it is quite accurate and does exactly what's needed.
It even has an added bonus of reusing the existing fixtures instead of creating new ones, which is something I did not initially think of, but is the right thing to do here.
Great job :)
Changes:
networks_pre_query
filter result assigned to thenetworks
property of the currentWP_Network_Query
instance.sites_pre_query
filter result assigned to thesites
property of the currentWP_Site_Query
instance.Trac ticket: https://core.trac.wordpress.org/ticket/51333