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'
Return Return
(string)
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; } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: