LLMS_Course::get_difficulty( string $field = 'name' )

Get Difficulty


Parameters Parameters

$field

(string) (Optional) Which field to return from the available term fields. Any public variables from a WP_Term object are acceptable: term_id, name, slug, and more. Default is 'name'.

Default value: 'name'


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/models/model.llms.course.php

	 */
	public function get_difficulty( $field = 'name' ) {

		$terms = get_the_terms( $this->get( 'id' ), 'course_difficulty' );

		if ( false === $terms ) {
			return '';
		}

		$difficulties = wp_list_pluck( $terms, $field );
		return implode( ', ', $difficulties );

	}

	/**
	 * Retrieve course instructor information
	 *
	 * @since 3.13.0


Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.