esc_html__( 'OceanWP Theme Setting', 'oceanwp' ), 'toggleable' => true, 'fields' => array( array( array( 'attribute' => 'ocean_post_layout', 'label' => esc_html__( 'Layout', 'oceanwp' ), 'type' => 'select', 'options' => array( '' => esc_html__( 'Default', 'oceanwp' ), 'right-sidebar' => esc_html__( 'Right Sidebar', 'oceanwp' ), 'left-sidebar' => esc_html__( 'Left Sidebar', 'oceanwp' ), 'full-width' => esc_html__( 'Full Width', 'oceanwp' ), 'full-screen' => esc_html__( 'Full Screen', 'oceanwp' ), 'both-sidebars' => esc_html__( 'Both Sidebar', 'oceanwp' ), ), ), ), ), ); return $fields; } /** * Distraction free on cart/checkout * * @since 1.5.0 */ public static function distraction_free( $return ) { if ( is_llms_checkout() && true == get_theme_mod( 'ocean_llms_distraction_free_checkout', false ) ) { $return = false; } if( ( is_course() || is_lesson() ) && true == get_theme_mod( 'ocean_llms_distraction_free_learning', false ) ) { $return = false; } return $return; } /** * LLMS Courses and Membership Page Columns. * * @since 1.0.0 * @param number $columns default number of columns (3). * @return number */ function archive_columns( $columns ) { if ( is_post_type_archive( 'course' ) || is_tax( array( 'course_cat', 'course_tag', 'course_difficulty', 'course_track' ) ) ) { $columns = get_theme_mod( 'ocean_llms_courses_columns', 3 ); $columns = $columns ? $columns : '3'; return $columns; } elseif ( is_post_type_archive( 'llms_membership' ) || is_tax( array( 'membership_tag', 'membership_cat' ) ) ) { $columns = get_theme_mod( 'ocean_llms_membership_columns', 3 ); $columns = $columns ? $columns : '3'; return $columns; } } /** * LLMS Courses and Membership Page Responsive Columns. * * @since 1.0.0 * @param number $columns default number of columns (3). * @return number */ function archive_responsive_columns( $classes ) { if ( is_post_type_archive( 'course' ) || is_tax( array( 'course_cat', 'course_tag', 'course_difficulty', 'course_track' ) ) ) { // Responsive columns $tablet_columns = get_theme_mod( 'ocean_llms_tablet_courses_columns' ); $mobile_columns = get_theme_mod( 'ocean_llms_mobile_courses_columns' ); if ( ! empty( $tablet_columns ) ) { $classes[] = 'tablet-col'; $classes[] = 'tablet-' . $tablet_columns . '-col'; } if ( ! empty( $mobile_columns ) ) { $classes[] = 'mobile-col'; $classes[] = 'mobile-' . $mobile_columns . '-col'; } } elseif ( is_post_type_archive( 'llms_membership' ) || is_tax( array( 'membership_tag', 'membership_cat' ) ) ) { // Responsive columns $tablet_columns = get_theme_mod( 'ocean_llms_tablet_membership_columns' ); $mobile_columns = get_theme_mod( 'ocean_llms_mobile_membership_columns' ); if ( ! empty( $tablet_columns ) ) { $classes[] = 'tablet-col'; $classes[] = 'tablet-' . $tablet_columns . '-col'; } if ( ! empty( $mobile_columns ) ) { $classes[] = 'mobile-col'; $classes[] = 'mobile-' . $mobile_columns . '-col'; } } return $classes; } /** * Fix for the OceanWP Settings values not saved * * @since 1.2.10 */ public static function butterbean_fix( $post_id ) { butterbean()->update( $post_id ); } /** * Add typography options for the LifterLMS product title * * @since 1.0.0 */ public static function typography_settings( $settings ) { $settings['lifterlms_course_title'] = array( 'label' => esc_html__( 'LifterLMS Course/Lesson Title', 'oceanwp' ), 'target' => '.single-course .entry-title, .single-lesson .entry-title', 'defaults' => array( 'font-size' => '34', 'color' => '#333', 'line-height' => '1.4', 'letter-spacing' => '0.6', ), ); $settings['lifterlms_section_title'] = array( 'label' => esc_html__( 'LifterLMS Section Title', 'oceanwp' ), 'target' => '.llms-syllabus-wrapper .llms-section-title', 'defaults' => array( 'font-size' => '18', 'color' => '#fff', 'line-height' => '1.4', 'letter-spacing' => '0.6', ), ); $settings['lifterlms_lesson_title'] = array( 'label' => esc_html__( 'LifterLMS Lesson Title', 'oceanwp' ), 'target' => '.single-lesson .entry-title', 'defaults' => array( 'font-size' => '34', 'color' => '#333', 'line-height' => '1.4', 'letter-spacing' => '0.6', ), ); $settings['lifterlms_buy_button'] = array( 'label' => esc_html__( 'LifterLMS Buy Button', 'oceanwp' ), 'target' => '.llms-access-plan-footer .llms-button-action', 'exclude' => array( 'font-color' ), 'defaults' => array( 'font-size' => '12', 'line-height' => '1', ), ); return $settings; } /** * Adds color accents for LLMS styles. * * @since 1.0.0 */ public static function primary_texts( $texts ) { return array_merge( array( '.llms-course-navigation .llms-pre-text', '.llms-lesson-preview.is-free .llms-lesson-complete', '.llms-lesson-preview.is-complete .llms-lesson-complete', '.llms-loop-item-content .llms-loop-title:hover', '.llms-meta-info .llms-meta a:hover', ), $texts ); } /** * Adds border accents for LLMS styles. * * @since 1.0.0 */ public static function primary_borders( $borders ) { return array_merge( array( '.llms-instructor-info .llms-instructors .llms-author' => array( 'top' ), '.llms-notification' => array( 'top' ), '.llms-instructor-info .llms-instructors .llms-author .avatar', ), $borders ); } /** * Adds background accents for LLMS styles. * * @since 1.0.0 */ public static function primary_backgrounds( $backgrounds ) { return array_merge( array( '.llms-button-action', '.llms-button-secondary', '.llms-field-button', '.llms-button-primary', '.llms-progress .progress-bar-complete', '.llms-instructor-info .llms-instructors .llms-author .avatar', '.llms-syllabus-wrapper .llms-section-title', '.llms-access-plan-title', '.llms-access-plan .stamp', '.llms-lesson-preview .llms-icon-free', '.llms-student-dashboard .llms-status.llms-active', '.llms-student-dashboard .llms-status.llms-completed', '.llms-student-dashboard .llms-status.llms-txn-succeeded', '.llms-checkout-wrapper .llms-form-heading', ), $backgrounds ); } /** * Adds background hover accents for LLMS styles. * * @since 1.0.0 */ public static function hover_primary_backgrounds( $hover ) { return array_merge( array( '.llms-button-action:hover', '.llms-button-secondary:hover', '.llms-field-button:hover', '.llms-button-primary:hover', '.llms-button-action:focus', '.llms-button-secondary:focus', '.llms-field-button:focus', '.llms-button-primary:focus', ), $hover ); } /** * Adds border color elements for LLMS styles. * * @since 1.0.0 */ public static function border_color_elements( $elements ) { return array_merge( array( '.llms-sd-notification-center .llms-notification', ), $elements ); } } endif; return new OceanWP_LifterLMS();