/** * Removes cache contents for a given group. * * @codeCoverageIgnore * * @param string $group The cache group. * @param string $suffix The suffix. Optional. * * @return bool */ function xu_cache_delete_group($group, $suffix = '') { if (!function_exists('wp_cache_delete_group')) { return false; } return wp_cache_delete_group(xu_cache_key($group, $suffix)); }
/** * Cached version of `wp_get_attachment_image_srcset`. * * @see https://developer.wordpress.org/reference/functions/wp_get_attachment_image_srcset/ * * @param int $attachment_id * @param array|string $size * @param array $image_meta * * @return string */ function xu_wp_get_attachment_image_srcset($attachment_id, $size = 'medium', $image_meta = null) { return xu_cache_get('wp_get_attachment_image_srcset', [$attachment_id, $size, $image_meta], xu_cache_key(__FUNCTION__, $attachment_id)); }