#51333 closed defect (bug) (fixed)
Assign 'sites_pre_query' and 'networks_pre_query' filter results to the class property
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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_queryshould be assigned to thenetworksproperty of the currentWP_Network_Queryinstance. - The array of site data returned from
sites_pre_queryshould be assigned to thesitesproperty of the currentWP_Site_Queryinstance.
Change History (8)
This ticket was mentioned in PR #544 on WordPress/wordpress-develop by yakimun.
5 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.
5 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
@
5 years ago
For reference, just noting that the second PR here was accidental and is actually from #51370.
dream-encode commented on PR #545:
5 years ago
#5
Merged into WP Core in https://core.trac.wordpress.org/changeset/49036
#7
@
5 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:
5 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_queryfilter result assigned to thenetworksproperty of the currentWP_Network_Queryinstance.sites_pre_queryfilter result assigned to thesitesproperty of the currentWP_Site_Queryinstance.Trac ticket: https://core.trac.wordpress.org/ticket/51333