[wp-trac] [WordPress Trac] #58189: post_type parameter in update_post_caches() accepts more than a single post type

WordPress Trac noreply at wordpress.org
Tue Apr 25 09:40:55 UTC 2023


#58189: post_type parameter in update_post_caches() accepts more than a single post
type
--------------------------+------------------------------
 Reporter:  DrewAPicture  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache API     |     Version:
 Severity:  trivial       |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+------------------------------

Comment (by spacedmonkey):

 I like this @DrewAPicture !

 Something I was wonder to make this clearer. Should we change this line

 {{{#!php
 function update_post_caches( &$posts, $post_type = 'post',
 $update_term_cache = true, $update_meta_cache = true ) {
 }}}


 to

 {{{#!php
 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.

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


More information about the wp-trac mailing list