get_post_custom returns no data when cache addition suspended
|Reported by:||leewillis77||Owned by:||duck_|
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.
Change History (11)
- Owner set to duck_
- Resolution set to fixed
- Status changed from new to closed