rveitch / elasticpress-featured-image-url

Automatically adds the featured image url to WordPress post meta for easy indexing with Elasticpress when posts are updated or published.
5 stars 1 forks source link

Add in thumbnail, medium and large images url #3

Open jacklai-list opened 5 years ago

jacklai-list commented 5 years ago

Overview

Add in thumbnail, medium and large images url

Mockups & Examples

Add the following code after the update_post_meta of $featured_image_url

$thumbnail_image_url = get_the_post_thumbnail_url( $post_id, 'thumbnail' ); update_post_meta( $post_id, 'thumbnail_image_url', $thumbnail_image_url );

$medium_image_url = get_the_post_thumbnail_url( $post_id, 'medium' ); update_post_meta( $post_id, 'medium_image_url', $medium_image_url );

$large_image_url = get_the_post_thumbnail_url( $post_id, 'large' ); update_post_meta( $post_id, 'large_image_url', $large_image_url );

shmaltz commented 3 years ago

@jacklai-list How can I use this with WooCommerce Variable products?