Last active
March 27, 2018 12:19
-
-
Save Auke1810/9580d6c953f3c5adabad95c909d1ec83 to your computer and use it in GitHub Desktop.
set image link feed manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alter_feed_item( $attributes, $feed_id, $product_id ) { | |
//global $product; | |
$product = wc_get_product( $product_id ); | |
$featured_image_ids[0] = get_post_thumbnail_id( $product_id ); | |
$featured_image = wp_get_attachment_image_src( get_post_thumbnail_id($featured_image_ids[0]), 'full'); | |
if($featured_image) { | |
$attributes['image_link'] = $featured_image[0]; | |
} | |
// IMPORTANT! Always return the $attributes | |
return $attributes; | |
} | |
add_filter( 'wppfm_feed_item_value', 'alter_feed_item', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment