astra_get_option( 'learndash-profile-link' ), ), $attrs ); $profile_link = esc_attr( $attrs['link'] ); self::astra_header_learndash( $profile_link ); return ob_get_clean(); } /** * LearnDash Profile Enabled. * * @return void */ public function learndash_profile_link_enabled() { if ( apply_filters( 'astra_learndash_profile_icon_enable', true ) && astra_get_option( 'learndash-profile-link-enabled' ) ) { $profile_link = astra_get_option( 'learndash-profile-link' ); self::astra_header_learndash( $profile_link ); } } /** * Add LearnDash icon markup * * @since 1.3.0 * @param string $profile_link Profile Link. * @return void */ public static function astra_header_learndash( $profile_link = '' ) { if ( is_user_logged_in() ) : ?>
is_header_footer_builder_active ) { remove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) ); remove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 ); } remove_action( 'astra_header', 'astra_header_markup' ); remove_action( 'astra_footer', 'astra_footer_markup' ); add_action( 'astra_header', array( $this, 'header_markup' ) ); add_action( 'astra_footer', array( $this, 'footer_markup' ) ); } } } /** * Header markup. */ public function header_markup() { astra_addon_get_template( 'learndash/templates/header.php' ); } /** * Footer markup. */ public function footer_markup() { astra_addon_get_template( 'learndash/templates/footer.php' ); } /** * Body Class * * @param array $classes Default argument array. * * @return array; */ public function body_class( $classes ) { $distraction_free_learning = astra_get_option( 'learndash-distraction-free-learning' ); if ( ( is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) || is_singular( 'sfwd-quiz' ) ) && $distraction_free_learning ) { $classes[] = 'learndash-distraction-free'; } return $classes; } /** * Add Styles */ public function add_styles() { /*** Start Path Logic */ /* Define Variables */ $uri = ASTRA_ADDON_EXT_LEARNDASH_URI . 'assets/css/'; $path = ASTRA_ADDON_EXT_LEARNDASH_DIR . 'assets/css/'; $rtl = ''; if ( is_rtl() ) { $rtl = '-rtl'; } /* Directory and Extension */ $file_prefix = $rtl . '.min'; $dir_name = 'minified'; if ( SCRIPT_DEBUG ) { $file_prefix = $rtl; $dir_name = 'unminified'; } $css_uri = $uri . $dir_name . '/'; $css_dir = $path . $dir_name . '/'; if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) { $gen_path = $css_uri; } else { $gen_path = $css_dir; } /*** End Path Logic */ /* Add style.css */ Astra_Minify::add_css( $gen_path . 'style' . $file_prefix . '.css' ); } } } /** * Kicking this off by calling 'get_instance()' method */ ASTRA_Ext_LearnDash_Markup::get_instance();