Skip to content

Commit

Permalink
Add the featured image to output of Download Details widget
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTOSCD committed Nov 1, 2014
1 parent ae50f35 commit 3274bdb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions widgets/download-details-featured-image.php
@@ -0,0 +1,18 @@
<?php
/**
* Add the featured image to output of Download Details widget
*/

function sd_edd_download_details_widget_thumbnail( $instance ) {

// get the ID of the current post
$post_id = get_the_ID();

// grab featured image of the appropriate download
if ( 'current' == $instance['download_id'] ) {
echo get_the_post_thumbnail( $post_id );
} else {
echo get_the_post_thumbnail( $instance['download_id'] );
}
}
add_action( 'edd_product_details_widget_before_purchase_button', 'sd_edd_download_details_widget_thumbnail' );

0 comments on commit 3274bdb

Please sign in to comment.