importable-courses.php 1.15 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
<?php
/**
 * List importable courses
 *
 * @package LifterLMS/Admin/Views
 *
 * @since 4.8.0
 * @version 4.8.0
 *
 * @property array[] $courses List of importable course data.
 */

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

<?php if ( is_wp_error( $courses ) ) : ?>

	<p class="llms-error">
		<?php
			// Translators: %s = Text of the HTTP Request error message.
			printf( __( 'There was an error loading importable courses. Please reload the page to try again. [%s]', 'lifterlms' ), $courses->get_error_message() );
		?>
	</p>

<?php else : ?>
	<ul class="llms-importable-courses">
		<?php
		/**
		 * Action run prior to the output of an importable course list
		 *
		 * @since 4.8.0
		 *
		 * @param array[] $courses List of importable course data.
		 */
		do_action( 'llms_before_importable_courses', $courses );

		foreach ( $courses as $course ) {
			include LLMS_PLUGIN_DIR . 'includes/admin/views/importable-course.php';
		}

		/**
		 * Action run after the output of an importable course list
		 *
		 * @since 4.8.0
		 *
		 * @param array[] $courses List of importable course data.
		 */
		do_action( 'llms_after_importable_courses', $courses );
		?>
	</ul>
<?php endif; ?>