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

Get Difficulty


Description Description


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 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 '';

		} else {

			foreach ( $terms as $term ) {

				return $term->$field;

			}
		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: