| @@ -1,38 +1,38 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Shortcode display single instructor. | |
| 4 | - */ | |
| 5 | -namespace LearnPress\Shortcodes; | |
| 6 | - | |
| 7 | -use LearnPress\Helpers\Singleton; | |
| 8 | - | |
| 9 | -class CourseMaterialShortcode extends AbstractShortcode { | |
| 10 | - use singleton; | |
| 11 | - protected $shortcode_name = 'course_materials'; | |
| 12 | - | |
| 13 | - /** | |
| 14 | - * Show single instructor | |
| 15 | - * | |
| 16 | - * @param $attrs [instructor_id: int] | |
| 17 | - * | |
| 18 | - * @return string | |
| 19 | - */ | |
| 20 | - public function render( $attrs ): string { | |
| 21 | - $content = ''; | |
| 22 | - | |
| 23 | - try { | |
| 24 | - if ( empty( $attrs ) ) { | |
| 25 | - $attrs = []; | |
| 26 | - } | |
| 27 | - ob_start(); | |
| 28 | - do_action( 'learn-press/course-material/layout', $attrs ); | |
| 29 | - $content = ob_get_clean(); | |
| 30 | - } catch ( \Throwable $e ) { | |
| 31 | - ob_end_clean(); | |
| 32 | - error_log( $e->getMessage() ); | |
| 33 | - } | |
| 34 | - | |
| 35 | - return $content; | |
| 36 | - } | |
| 37 | -} | |
| 38 | - | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Shortcode display single instructor. | |
| 4 | + */ | |
| 5 | +namespace LearnPress\Shortcodes; | |
| 6 | + | |
| 7 | +use LearnPress\Helpers\Singleton; | |
| 8 | + | |
| 9 | +class CourseMaterialShortcode extends AbstractShortcode { | |
| 10 | + use singleton; | |
| 11 | + protected $shortcode_name = 'course_materials'; | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * Show single instructor | |
| 15 | + * | |
| 16 | + * @param $attrs [instructor_id: int] | |
| 17 | + * | |
| 18 | + * @return string | |
| 19 | + */ | |
| 20 | + public function render( $attrs ): string { | |
| 21 | + $content = ''; | |
| 22 | + | |
| 23 | + try { | |
| 24 | + if ( empty( $attrs ) ) { | |
| 25 | + $attrs = []; | |
| 26 | + } | |
| 27 | + ob_start(); | |
| 28 | + do_action( 'learn-press/course-material/layout', $attrs ); | |
| 29 | + $content = ob_get_clean(); | |
| 30 | + } catch ( \Throwable $e ) { | |
| 31 | + ob_end_clean(); | |
| 32 | + error_log( $e->getMessage() ); | |
| 33 | + } | |
| 34 | + | |
| 35 | + return $content; | |
| 36 | + } | |
| 37 | +} | |
| 38 | + | |