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


Top ↑

Return Return

(array)


Top ↑

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;
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.