LLMS_Post_Instructors::get_instructors( boolean $exclude_hidden = false )
Retrieve course instructor information
Description Description
Parameters Parameters
- $exclude_hidden
-
(boolean) (Optional) if true, excludes hidden instructors from the return array
Default value: false
Return Return
(array)
Source Source
File: includes/models/model.llms.post.instructors.php
public function get_instructors( $exclude_hidden = false ) { $instructors = $this->post->get( 'instructors' ); // if empty, respond with the course author in an array if ( ! $instructors ) { $instructors = array( wp_parse_args( array( 'id' => $this->post->get( 'author' ), ), llms_get_instructors_defaults() ) ); } if ( $exclude_hidden ) { foreach ( $instructors as $key => $instructor ) { if ( 'hidden' === $instructor['visibility'] ) { unset( $instructors[ $key ] ); } } } return $instructors; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.13.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: