Add Easy Digital Downloads integration to the GMT Courses plugin.
Getting started with EDD for Courses is as simple as installing a plugin:
- Upload the
gmt-edd-for-courses
folder to the/wp-content/plugins/
directory. - Activate the plugin through the Plugins menu in WordPress.
- Select which downloads should have access to a course under
Lessons
>Courses
in the Dashboard.
And that's it, you're done. Nice work!
It's recommended that you also install the GitHub Updater plugin to get automattic updates.
/**
* Get all available downloads
* @param boolean $any If true, get all downloads, including unpublished
* @return array The downloads
*/
gmt_edd_for_courses_get_downloads( $any = true );
/**
* Get all available courses
* @param boolean $any If true, get all courses, including unpublished
* @return array The courses
*/
function gmt_edd_for_courses_get_courses( $any = true );
/**
* Get the downloads a user has purchased
* @param string $email The user's email address
* @return array The user's downloads
*/
gmt_edd_for_courses_get_user_downloads( $email = null );
/**
* Get the courses that the user has access to
* @param string $email The user's email address
* @return array The courses that the user has access to
*/
gmt_edd_for_courses_get_purchased_courses( $email = null );
/**
* Check if user can access a course
* @param number $course_id The course ID
* @param string $email The user's email address
* @return boolean If true, the user can access the course
*/
gmt_edd_for_courses_user_has_access( $course_id = null, $email = null );
/**
* Get the download links that the user has access to for a course
* @param number $course_id The course ID
* @param string $email The user's email address
* @return array The course downloads
*/
gmt_edd_for_courses_get_download_links( $course_id = null, $email = null );
Create buy now links that disable and display a custom message when the visitor has already purchased the download.
[edd_for_courses_buy_now id="DOWNLOAD_ID"]
Options:
checkout
- Iftrue
, send buyer directly to checkoutgateway
- Iftrue
, send buyer directly to payment gatewayprice
- (integer) A specific price ID to use for variable pricingdiscount
- Automatically add a discount code to the purchasebuy
- The language to use for the linkowned
- The language to use if the visitor already owns the downloadclass
- The class(es) to use for the link
[edd_for_courses_buy_now id="123" checkout="true" price="2" buy="Buy Now!" owned="You already own this course" class="btn"]
Please read the Contribution Guidelines.
The code is available under the GPLv3.