Skip to content

Instantly share code, notes, and snippets.

View xavierlopez's full-sized avatar

Xavier López xavierlopez

View GitHub Profile
$shortcode_course = '[course_content course_id="'.$course_id.'"]';
// echo LearnDash lessons from course_id
echo do_shortcode("$shortcode_course" );
@xavierlopez
xavierlopez / functions.php
Last active November 15, 2021 07:21
How to get related course from product (LearnDash WooCommerce integration)
//Here we get an array of related LearnDash courses related to a WC_Product
$courses_id = get_post_meta( $product->get_id(), '_related_course',true);