WordPress Snippets at WPcustoms

conditional check if user has purchased easy digital downloads item

Easy digital downloads plugin addon checks if a user has purchased an item


/**
 * Snippet Name: conditional check if user has purchased easy digital downloads item
 * Snippet URL: http://www.wpcustoms.net/snippets/conditional-check-if-user-has-purchased-easy-digital-downloads-item/
 */
 function edd_has_purchased() {
    if( edd_has_user_purchased( get_current_user_id(), get_the_ID() ) ) {
  // they have purchased
  echo '
purchased
'; } else { // they have not purchased echo ''; } }