ShortCode
Source
File: classes/ShortCode.php
class ShortCode{ public static function instance() { static $instance = null; if ( null === $instance ) { $instance = new self(); } return $instance; } public function __construct() { add_shortcode( 'dozent_user_signup', array( $this, 'user_signup' ) ); add_shortcode( 'dozent_author_meta', array( $this, 'author_meta' ) ); add_shortcode( 'dozent_course_title', array( $this, 'course_title' ) ); add_shortcode( 'dozent_author_meta', array( $this, 'author_meta' ) ); add_shortcode( 'dozent_course_excerpt', array( $this, 'course_excerpt' ) ); add_shortcode( 'dozent_course_loop_level', array( $this, 'course_loop_level' ) ); add_shortcode( 'dozent_course_total_lectures', array( $this, 'course_total_lectures' ) ); } /** * @return mixed|void * * Instructor signup page. */ public function user_signup(){ ob_start(); dozent_load_template( 'shortcode/user-signup' ); return apply_filters( 'dozent/user_signup', ob_get_clean() ); } /** * @return mixed|void * * Return Course Title */ public function course_title(){ ob_start(); dozent_load_template( 'loop/course-title' ); return apply_filters( 'dozent/shortcode/course-title', ob_get_clean() ); } public function author_meta(){ ob_start(); dozent_load_template( 'single.course.author-meta' ); return apply_filters( 'dozent/shortcode/author-meta', ob_get_clean() ); } public function course_excerpt(){ ob_start(); dozent_load_template( 'loop/course-excerpt' ); return apply_filters( 'dozent/shortcode/course-excerpt', ob_get_clean() ); } public function course_loop_level(){ ob_start(); dozent_load_template( 'loop/course-level' ); return apply_filters( 'dozent/shortcode/course-level', ob_get_clean() ); } public function course_total_lectures(){ ob_start(); dozent_load_template( 'loop/total-lectures' ); return apply_filters( 'dozent/shortcode/total-lectures', ob_get_clean() ); } }