Last active
August 29, 2015 14:05
-
-
Save SeanChDavis/3f306e53d940ea248712 to your computer and use it in GitHub Desktop.
EDD Download Thumbnail in Download Details Widget
This file contains hidden or 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 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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment