dozent_get_attached_course_ids_to_product( int $product_id )

Get all course ID attached to a specific Product


Parameters

$product_id

(int) (Required) Product ID


Return

(array)


Source

File: includes/integration-functions.php

71
72
73
74
75
76
77
function dozent_get_attached_course_ids_to_product( $product_id ) {
    global $wpdb;
 
    $course_ids = $wpdb->get_col( "SELECT post_id from {$wpdb->postmeta} WHERE meta_key = '_attached_product_id' AND meta_value = '{$product_id}' " );
 
    return $course_ids;
}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.