Opened 18 months ago
Last modified 15 months ago
#58189 new defect (bug)
post_type parameter in update_post_caches() accepts more than a single post type
Reported by: | DrewAPicture | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | trivial | Version: | |
Component: | Cache API | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
In update_post_caches()
, the post_type
parameter is documented as only accepting a single post type, which is inaccurate. It actually accepts a single post type, 'any' for any post type, and also an array of post types.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
I like this @DrewAPicture !
Something I was wonder to make this clearer. Should we change this line
function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) {
to
function update_post_caches( &$posts, $post_types = array( 'post' ), $update_term_cache = true, $update_meta_cache = true ) {
It gets converted to an array on line 7399 anyway.
I think it maybe would be clearer, if it was post types.