Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelogs/lesson-navigation-shortcode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: added
entry: Added [lifterlms_lesson_navigation] shortcode.
47 changes: 47 additions & 0 deletions includes/shortcodes/class.llms.shortcode.lesson.navigation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* LifterLMS Lesson Navigation Shortcode
*
* [lifterlms_lesson_navigation]
*
* @package LifterLMS/Shortcodes/Classes
*
* @since [version]
* @version [version]
*/

defined( 'ABSPATH' ) || exit;

/**
* LLMS_Shortcode_Lesson_Navigation
*
* @since [version]
*/
class LLMS_Shortcode_Lesson_Navigation extends LLMS_Shortcode {

/**
* Shortcode tag
*
* @var string
*/
public $tag = 'lifterlms_lesson_navigation';

/**
* Retrieve the actual content of the shortcode
*
* $atts & $content are both filtered before being passed to get_output()
* output is filtered so the return of get_output() doesn't need its own filter
*
* @since [version]
*
* @return string
*/
protected function get_output() {

ob_start();
lifterlms_template_lesson_navigation();
return ob_get_clean();
}
}

return LLMS_Shortcode_Lesson_Navigation::instance();
2 changes: 2 additions & 0 deletions includes/shortcodes/class.llms.shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct() {
* @since 6.0.0 Removed loading of class files that don't instantiate their class in favor of autoloading.
* @since 6.4.0 Allowed `LLMS_Shortcode_User_Info` class to be filtered.
* @since 7.5.0 Added `LLMS_Shortcode_Favorites` class in shortcodes array.
* @since [version] Added `LLMS_Shortcode_Lesson_Navigation` class in shortcodes array.
*
* @return void
*/
Expand Down Expand Up @@ -66,6 +67,7 @@ public static function init() {
'LLMS_Shortcode_Courses',
'LLMS_Shortcode_Hide_Content',
'LLMS_Shortcode_Lesson_Mark_Complete',
'LLMS_Shortcode_Lesson_Navigation',
'LLMS_Shortcode_Membership_Link',
'LLMS_Shortcode_Membership_Instructors',
'LLMS_Shortcode_My_Achievements',
Expand Down
Loading