should_load() ) { return; } $this->load_hooks(); } /** * Check if LifterLMS plugin is activated. */ private function should_load() { return class_exists( 'LifterLMS' ); } /** * Load hooks and filters. */ private function load_hooks() { add_action( 'wp_enqueue_scripts', array( $this, 'load_styles' ) ); remove_action( 'lifterlms_before_main_content', 'lifterlms_output_content_wrapper', 10 ); remove_action( 'lifterlms_after_main_content', 'lifterlms_output_content_wrapper_end', 10 ); remove_all_actions( 'lifterlms_sidebar' ); add_action( 'lifterlms_before_main_content', array( $this, 'content_wrapper_open' ), 0 ); add_action( 'lifterlms_after_main_content', array( $this, 'content_wrapper_close' ), PHP_INT_MAX ); add_filter( 'lifterlms_show_page_title', '__return_false' ); add_action( 'neve_llms_content', array( $this, 'content_open' ), 10 ); add_action( 'lifterlms_after_main_content', array( $this, 'content_close' ), 10 ); add_action( 'widgets_init', array( $this, 'register_catalog_sidebar' ) ); add_filter( 'llms_get_theme_default_sidebar', array( $this, 'lms_sidebar' ) ); add_action( 'wp', array( $this, 'load_catalog_sidebar' ) ); add_filter( 'llms_checkout_error_output', array( $this, 'checkout_error_entry_content_close' ) ); } /** * Enqueue styles. */ public function load_styles() { wp_enqueue_style( 'neve-lifter', NEVE_ASSETS_URL . 'css/lifter' . ( ( NEVE_DEBUG ) ? '' : '.min' ) . '.css', array(), apply_filters( 'neve_version_filter', NEVE_VERSION ) ); } /** * Load Sidebar */ public function load_catalog_sidebar() { $sidebar_position = get_theme_mod( 'neve_default_sidebar_layout', 'right' ); if ( $sidebar_position === 'right' ) { add_action( 'lifterlms_after_main_content', array( $this, 'render_catalog_sidebar' ), 11 ); } if ( $sidebar_position === 'left' ) { add_action( 'neve_llms_content', array( $this, 'render_catalog_sidebar' ), 1 ); } } /** * Display LifterLMS Course and Lesson sidebars * on courses and lessons in place of the sidebar returned by * this function * * @return string */ public function lms_sidebar() { return 'blog-sidebar'; } /** * Add markup before main content. */ public function content_wrapper_open() { $container_class = apply_filters( 'neve_container_class_filter', 'container' ); echo '