WC_Helper_Updater::get_cached_products
Extract the products from a cached update-check payload.
Used on the paths that serve the previous cache rather than a fresh response — while rate limited, and on the rate-limited response itself.
Method of the class: WC_Helper_Updater{}
No Hooks.
Returns
array. The cached products, or an empty array when there are none.
Usage
$result = WC_Helper_Updater::get_cached_products( $data );
- $data(mixed) (required)
- The data retrieved from the transient, of any shape.
WC_Helper_Updater::get_cached_products() WC Helper Updater::get cached products code WC 11.2.2
private static function get_cached_products( $data ) {
return ( is_array( $data ) && isset( $data['products'] ) && is_array( $data['products'] ) )
? $data['products']
: array();
}