/** * Return image source URL to the first product image assigned to the product with the given post id * * @return string */ function cc_primary_image_for_product($post_id, $size = 'cc-gallery-full') { $primary_src = ''; $images = cc_get_product_image_sources($size, $post_id, true); if (is_array($images)) { $primary_src = array_shift($images); } return $primary_src; }
function cc_get_product_thumb_sources($post_id) { $thumbs = cc_get_product_image_sources('cc-gallery-thumb', $post_id); return $thumbs; }