WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 4 days ago

#51333 reviewing defect (bug)

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 the networks property of the current WP_Network_Query instance.
  • The array of site data returned from sites_pre_query should be assigned to the sites property of the current WP_Site_Query instance.

Change History (5)

This ticket was mentioned in PR #544 on WordPress/wordpress-develop by yakimun.


5 weeks ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

Changes:

  • networks_pre_query filter result assigned to the networks property of the current WP_Network_Query instance.
  • sites_pre_query filter result assigned to the sites property of the current WP_Site_Query instance.

Trac ticket: https://core.trac.wordpress.org/ticket/51333

This ticket was mentioned in PR #545 on WordPress/wordpress-develop by campusboy87.


5 weeks ago

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

#3 @SergeyBiryukov
5 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
5 weeks ago

For reference, just noting that the second PR here was accidental and is actually from #51370.

Note: See TracTickets for help on using tickets.