[wp-trac] [WordPress Trac] #19708: get_post_custom returns no data when cache addition suspended

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 23 21:55:44 UTC 2012


#19708: get_post_custom returns no data when cache addition suspended
--------------------------+------------------
 Reporter:  leewillis77   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.4
Component:  General       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by leewillis77):

 As with #19690, the use case that caused me to stumble on this is in
 plugins that wish to iterate over all (or a potentially large number of)
 posts. The specific use case that caused this is generating an XML feed of
 product information from e-Commerce stores for Google Merchant Centre.

 In this context you want to iterate over all posts of a specific type, but
 there's no specific advantage in adding those posts (Or related
 information) to the cache - hence the use of
 wp_suspend_cache_addition(true).

 Unfortunately as soon as cache additions are suspended, get_post_custom
 fails to return data for posts that do have custom info set.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19708#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list