Browse: Home / Functions /

learndash_get_course_price

learndash_get_course_price( int|WP_Post|null $course = null,  int $user_id )

Gets the course price.


Description #

Return an array of price type, amount and cycle.


Parameters #

$course

(int|WP_Post|null) (Optional) Course WP_Post object or post ID. Default to global $post.

Default value: null

$user_id

(int) (Required) User ID. Default to current user ID.


Return #

(array) Course price details.


Source #

File: includes/payments/ld-payments-functions.php


Changelog #

Changelog
Version Description
4.5.0 Param $user_id is not nullable.
4.1.0 Optional $user_id param added.
3.0.0 Introduced.