instructors.php 1.54 KB
Newer Older
cyrille's avatar
cyrille committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<?php
/**
 * Course & Membership Instructors Block
 *
 * @package LifterLMS/Templates/Shared
 *
 * @since 4.11.0
 * @version 4.11.0
 *
 * @param LLMS_Post_Model $llms_post   Instance of the LLMS_Post_Model for the current screen.
 * @param array[]         $instructors Array of instructor data from the post's `get_instructors()` method.
 * @param int             $count       Number of instructors found in the `$instructors` array.
 */

defined( 'ABSPATH' ) || exit;
?>

<section class="llms-instructor-info">
	<h3 class="llms-meta-title">
		<?php
		/**
		 * Filters the displayed title of the Instructors block
		 *
		 * @since 4.11.0
		 *
		 * @param string          $title     The block's title.
		 * @param LLMS_Post_Model $llms_post The post model object.
		 * @param int             $count     Number of instructors found, used to pluralize the title.
		 */
		echo apply_filters(
			'llms_instructors_info_title',
			// Translators: %s = The singular name of the post type, eg: "Course".
			sprintf( _n( '%s Instructor', '%s Instructors', $count, 'lifterlms' ), $llms_post->get_post_type_label() ),
			$llms_post,
			$count
		);
		?>
	</h3>
	<div class="llms-instructors llms-cols">
		<?php foreach ( $instructors as $instructor ) : ?>
			<div class="llms-col-<?php echo $count <= 4 ? $count : 4; ?>">
				<?php
				echo llms_get_author(
					array(
						'avatar_size' => 100,
						'bio'         => true,
						'label'       => $instructor['label'],
						'user_id'     => $instructor['id'],
					)
				);
				?>
			</div>
		<?php endforeach; ?>
	</div>
</section>