[wp-trac] [WordPress Trac] #51852: "any" value in "post_type" param in "get_posts" by default ignore attachments

WordPress Trac noreply at wordpress.org
Wed Dec 2 00:18:43 UTC 2020


#51852: "any" value in "post_type" param in "get_posts" by default ignore
attachments
------------------------------------------+-----------------------
 Reporter:  dam6pl                        |       Owner:  (none)
     Type:  defect (bug)                  |      Status:  assigned
 Priority:  normal                        |   Milestone:  5.7
Component:  Query                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  docs
------------------------------------------+-----------------------
Changes (by peterwilsoncc):

 * milestone:  Awaiting Review => 5.7


Comment:

 I have updated the `WP_Query` documentation in the developer handbook to
 note that [https://developer.wordpress.org/reference/classes/wp_query
 /#status-parameters the `inherit` status] is also excluded from `any`.

 In [attachment:"51852.diff"] I have changed the `get_posts()`
 documentation to:

 > Retrieves an array of the latest posts, or posts matching the given
 criteria.
 >
 > For more information on the accepted arguments, see the
 [https://developer.wordpress.org/reference/classes/wp_query/ WP_Query]
 documentation in the Developer Handbook.
 >
 > The `$ignore_sticky_posts` and `$no_found_rows` arguments are ignored by
 this function and both are set to `true`.

 Following out discussion above, I've moved this on to the 5.7 milestone
 for the documentation changes.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51852#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list