LLMS_Sidebars::replace_default_sidebars( array $widgets )
Replaces existing sidebars with Course / Lesson sidebar widgets for supporting themes
Parameters Parameters
- $widgets
-
(array) (Required) array of sidebars and their widgets
Return Return
(array)
Source Source
File: includes/class.llms.sidebars.php
public static function replace_default_sidebars( $widgets ) {
if ( is_singular( 'course' ) || is_singular( 'lesson' ) ) {
$sidebar_id = self::get_theme_default_sidebar();
if ( $sidebar_id ) {
if ( is_singular( 'course' ) && array_key_exists( 'llms_course_widgets_side', $widgets ) ) {
$widgets[ $sidebar_id ] = $widgets['llms_course_widgets_side'];
} elseif ( is_singular( 'lesson' ) && array_key_exists( 'llms_lesson_widgets_side', $widgets ) ) {
$widgets[ $sidebar_id ] = $widgets['llms_lesson_widgets_side'];
}
}
}
return $widgets;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Unknown. |
| 1.0.0 | Introduced. |