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
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | 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. |