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


Top ↑

Return Return

(array)


Top ↑

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;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: