Opened 3 years ago
Closed 3 months ago
#58189 closed defect (bug) (fixed)
post_type parameter in update_post_caches() accepts more than a single post type
| Reported by: | DrewAPicture | Owned by: | spacedmonkey |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Cache API | Version: | |
| Severity: | trivial | Keywords: | has-patch commit |
| Cc: | Focuses: | docs |
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 (2)
Change History (8)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.