[wp-trac] [WordPress Trac] #19708: get_post_custom returns no data when cache addition suspended
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 1 10:09:09 UTC 2012
#19708: get_post_custom returns no data when cache addition suspended
--------------------------+-----------------------------
Reporter: leewillis77 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.3
Severity: normal | Keywords:
--------------------------+-----------------------------
If cache addition is suspended via wp_suspend_cache_addition(true) then
get_post_custom($foo) returns no data.
The cause is that in optimising for performance inside get_post_custom an
assumption that cache values can be stored and subsequently retrieved. As
a result, the return value is generated by calling wp_cache_get() which
will fail to return anything since cache additions are suspended.
The values required are however already being generated and passed back
into get_post_custom. The attached patch returns these without relying on
a call to wp_cache_get.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19708>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list