3,
'tablet' => 2,
'mobile' => 1,
);
$defaults['llms-membership-grid'] = array(
'desktop' => 3,
'tablet' => 2,
'mobile' => 1,
);
// Container.
$defaults['lifterlms-content-layout'] = 'plain-container';
// Sidebar.
$defaults['lifterlms-sidebar-layout'] = 'no-sidebar';
$defaults['lifterlms-course-lesson-sidebar-layout'] = 'default';
return $defaults;
}
/**
* This function handles the HTML output of the reviews and review form.
* If the option is enabled, the review form will be output,
* if not, nothing will happen. This function also checks to
* see if a user is allowed to review more than once.
*
* @since 1.2.0
*/
public function single_reviews() {
/**
* Check to see if we are supposed to output the code at all
*/
if ( get_post_meta( get_the_ID(), '_llms_display_reviews', true ) ) {
?>
get_post_meta( get_the_ID(), '_llms_num_reviews', true ),
'post_type' => 'llms_review',
'post_status' => 'publish',
'post_parent' => get_the_ID(),
'suppress_filters' => true,
);
$posts_array = get_posts( $args );
$styles = array(
'background-color' => '#EFEFEF',
'title-color' => 'inherit',
'text-color' => 'inherit',
'custom-css' => '',
);
if ( has_filter( 'llms_review_custom_styles' ) ) {
$styles = apply_filters( 'llms_review_custom_styles', $styles );
}
foreach ( $posts_array as $post ) {
echo $styles['custom-css'];
?>
ID ) ); ?>
ID ) ) ); ?>
ID ); ?>
1,
'post_type' => 'llms_review',
'post_status' => 'publish',
'post_parent' => get_the_ID(),
'author' => get_current_user_id(),
'suppress_filters' => true,
);
$posts_array = get_posts( $args );
/**
* Check to see if we are allowed to write more than one review.
* If we are not, check to see if we have written a review already.
*/
if ( get_post_meta( get_the_ID(), '_llms_multiple_reviews_disabled', true ) && $posts_array ) {
?>
= 0 ) {
unset( $classes[ $index ] );
}
}
$classes[] = 'cols-' . $llms_grid['desktop'];
}
}
if ( ! empty( $llms_grid['tablet'] ) ) {
$classes[] = 'llms-tablet-cols-' . $llms_grid['tablet'];
}
if ( ! empty( $llms_grid['mobile'] ) ) {
$classes[] = 'llms-mobile-cols-' . $llms_grid['mobile'];
}
return $classes;
}
/**
* Enqueue styles
*
* @since 1.2.0
* @return void
*/
function add_dynamic_styles() {
/**
* - Variable Declaration
*/
$theme_color = astra_get_option( 'theme-color' );
$link_color = astra_get_option( 'link-color', $theme_color );
$text_color = astra_get_option( 'text-color' );
$link_h_color = astra_get_option( 'link-h-color' );
$theme_forground_color = astra_get_foreground_color( $link_color );
$btn_color = astra_get_option( 'button-color' );
if ( empty( $btn_color ) ) {
$btn_color = $theme_forground_color;
}
$btn_h_color = astra_get_option( 'button-h-color' );
if ( empty( $btn_h_color ) ) {
$btn_h_color = astra_get_foreground_color( $link_h_color );
}
$btn_bg_color = astra_get_option( 'button-bg-color', '', $link_color );
$btn_bg_h_color = astra_get_option( 'button-bg-h-color', '', $link_h_color );
$btn_border_radius = astra_get_option( 'button-radius' );
$btn_vertical_padding = astra_get_option( 'button-v-padding' );
$btn_horizontal_padding = astra_get_option( 'button-h-padding' );
$css_output = array(
'a.llms-button-primary, .llms-button-secondary, .llms-button-action, button.llms-field-button, a.llms-field-button' => array(
'color' => $btn_color,
'border-color' => $btn_bg_color,
'background-color' => $btn_bg_color,
),
'a.llms-button-primary, .llms-button-secondary, .llms-button-action, .llms-field-button, .llms-button-action.large' => array(
'border-radius' => astra_get_css_value( $btn_border_radius, 'px' ),
'padding' => astra_get_css_value( $btn_vertical_padding, 'px' ) . ' ' . astra_get_css_value( $btn_horizontal_padding, 'px' ),
),
'a.llms-button-primary:hover, a.llms-button-primary:focus, .llms-button-secondary:hover, .llms-button-secondary:focus, .llms-button-action:hover, .llms-button-action:focus, button.llms-field-button:hover, button.llms-field-button:focus, a.llms-field-button:hover, a.llms-field-button:focus' => array(
'color' => $btn_h_color,
'border-color' => $btn_bg_h_color,
'background-color' => $btn_bg_h_color,
),
'nav.llms-pagination ul li a:focus, nav.llms-pagination ul li a:hover, nav.llms-pagination ul li span.current' => array(
'background' => $link_color,
'color' => $btn_color,
),
'nav.llms-pagination ul, nav.llms-pagination ul li, .llms-instructor-info .llms-instructors .llms-author, .llms-instructor-info .llms-instructors .llms-author .avatar' => array(
'border-color' => $link_color,
),
'.llms-progress .progress-bar-complete, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, .color-full, body .llms-syllabus-wrapper .llms-section-title' => array(
'background' => $link_color,
),
'.llms-lesson-preview.is-complete .llms-lesson-complete, .llms-lesson-preview.is-free .llms-lesson-complete, .llms-widget-syllabus .lesson-complete-placeholder.done, .llms-widget-syllabus .llms-lesson-complete.done, .single-llms_quiz .llms-quiz-results .llms-donut.passing, .llms-quiz-timer' => array(
'color' => $link_color,
),
'.llms-quiz-timer' => array(
'border-color' => $link_color,
),
'.single-llms_quiz .llms-quiz-results .llms-donut.passing svg path' => array(
'stroke' => $link_color,
),
'h4.llms-access-plan-title, .llms-instructor-info .llms-instructors .llms-author .avatar, h4.llms-access-plan-title, .llms-lesson-preview .llms-icon-free, .llms-access-plan .stamp, .llms-student-dashboard .llms-status.llms-active, .llms-student-dashboard .llms-status.llms-completed, .llms-student-dashboard .llms-status.llms-txn-succeeded, body .llms-syllabus-wrapper .llms-section-title' => array(
'color' => $theme_forground_color,
),
'body .progress-bar-complete:after' => array(
'color' => $theme_forground_color,
),
);
/* Parse CSS from array() */
$css_output = astra_parse_css( $css_output );
wp_add_inline_style( 'lifterlms-styles', apply_filters( 'astra_theme_lifterlms_dynamic_css', $css_output ) );
}
/**
* Add start of wrapper
*
* @since 1.2.0
* @return void
*/
function before_main_content_start() {
$site_sidebar = astra_page_layout();
if ( 'left-sidebar' == $site_sidebar ) {
get_sidebar();
}
?>
'ast-main-header-display',
'id' => 'ast-main-header-display',
'label' => esc_html__( 'Disable Primary Header', 'astra' ),
'switch_on' => 'disabled',
'type' => 'switch',
);
if ( $show_meta_field ) {
$disable_fields[] = array(
'attribute' => 'site-post-title',
'id' => 'site-post-title',
'label' => esc_html__( 'Disable Title', 'astra' ),
'switch_on' => 'disabled',
'type' => 'switch',
);
}
if ( $show_meta_field && 'disabled' != astra_get_option( 'footer-adv' ) ) {
$disable_fields[] = array(
'attribute' => 'footer-adv-display',
'id' => 'footer-adv-display',
'label' => esc_html__( 'Disable Footer Widgets', 'astra' ),
'switch_on' => 'disabled',
'type' => 'switch',
);
}
if ( 'disabled' != astra_get_option( 'footer-sml-layout' ) ) {
$disable_fields[] = array(
'attribute' => 'footer-sml-layout',
'id' => 'footer-sml-layout',
'label' => esc_html__( 'Disable Footer Bar', 'astra' ),
'switch_on' => 'disabled',
'type' => 'switch',
);
}
$fields['astra_theme_settings'] = array(
'title' => __( 'Astra Settings', 'astra' ),
'toggleable' => true,
'fields' => apply_filters(
'astra_theme_lifterlms_settings',
array(
array(
array(
'attribute' => 'site-sidebar-layout',
'id' => 'site-sidebar-layout',
'label' => esc_html__( 'Sidebar', 'astra' ),
'type' => 'select',
'options' => array(
'default' => esc_html__( 'Customizer Setting', 'astra' ),
'left-sidebar' => esc_html__( 'Left Sidebar', 'astra' ),
'right-sidebar' => esc_html__( 'Right Sidebar', 'astra' ),
'no-sidebar' => esc_html__( 'No Sidebar', 'astra' ),
),
),
array(
'attribute' => 'site-content-layout',
'id' => 'site-content-layout',
'label' => esc_html__( 'Content Layout', 'astra' ),
'type' => 'select',
'options' => array(
'default' => esc_html__( 'Customizer Setting', 'astra' ),
'boxed-container' => esc_html__( 'Boxed', 'astra' ),
'content-boxed-container' => esc_html__( 'Content Boxed', 'astra' ),
'plain-container' => esc_html__( 'Full Width / Contained', 'astra' ),
'page-builder' => esc_html__( 'Full Width / Stretched', 'astra' ),
),
),
),
$disable_fields,
)
),
);
$default_fields['assignment'] = $fields;
$default_fields['lesson'] = $fields;
$default_fields['quiz'] = $fields;
return $default_fields;
}
}
endif;
/**
* Kicking this off by calling 'get_instance()' method
*/
if ( apply_filters( 'astra_enable_lifterlms_integration', true ) ) {
Astra_LifterLMS::get_instance();
}