Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekarice/44625b501f4eafe075e8 to your computer and use it in GitHub Desktop.
Save bekarice/44625b501f4eafe075e8 to your computer and use it in GitHub Desktop.
Adds JP sharing buttons before the EDD purchase button on single download pages
/**
* Adds sharing buttons before purchase button
* Tutorial: http://www.sellwithwp.com/add-social-sharing-buttons-to-easy-digital-downloads/
**/
function add_edd_share_buttons() {
if ( function_exists( 'sharing_display' ) && is_singular( 'download' ) ) {
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
echo sharing_display();
}
}
add_action( 'edd_purchase_link_top', 'add_edd_share_buttons' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment