/home/techb158/balacoffee.com/wp-content/themes/Divi-1/includes/builder/module
Edit: /home/techb158/balacoffee.com/wp-content/themes/Divi-1/includes/builder/module/SliderItem.php (47680B)
name = et_builder_i18n( 'Slide' );
$this->plural = esc_html__( 'Slides', 'et_builder' );
$this->slug = 'et_pb_slide';
$this->vb_support = 'on';
$this->type = 'child';
$this->child_title_var = 'admin_title';
$this->child_title_fallback_var = 'heading';
$this->advanced_setting_title_text = esc_html__( 'New Slide', 'et_builder' );
$this->settings_text = esc_html__( 'Slide Settings', 'et_builder' );
$this->main_css_element = '%%order_class%%';
$this->settings_modal_toggles = array(
'general' => array(
'toggles' => array(
'main_content' => et_builder_i18n( 'Text' ),
'image_video' => esc_html__( 'Image & Video', 'et_builder' ),
'player_pause' => esc_html__( 'Player Pause', 'et_builder' ),
'admin_label' => array(
'title' => et_builder_i18n( 'Admin Label' ),
'priority' => 99,
),
),
),
'advanced' => array(
'toggles' => array(
'overlay' => et_builder_i18n( 'Overlay' ),
'navigation' => esc_html__( 'Navigation', 'et_builder' ),
'image' => array(
'title' => et_builder_i18n( 'Image' ),
),
'text' => array(
'title' => et_builder_i18n( 'Text' ),
'priority' => 49,
),
),
),
'custom_css' => array(
'toggles' => array(
'attributes' => array(
'title' => esc_html__( 'Attributes', 'et_builder' ),
'priority' => 95,
),
),
),
);
$this->advanced_fields = array(
'fonts' => array(
'header' => array(
'label' => et_builder_i18n( 'Title' ),
'css' => array(
'main' => ".et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_slide_description .et_pb_slide_title",
'limited_main' => ".et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_slide_description .et_pb_slide_title, .et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_slide_description .et_pb_slide_title a",
'important' => 'all',
),
'line_height' => array(
'range_settings' => array(
'min' => '1',
'max' => '100',
'step' => '0.1',
),
),
'header_level' => array(
'default' => 'h2',
),
),
'body' => array(
'label' => et_builder_i18n( 'Body' ),
'css' => array(
'main' => ".et_pb_slider.et_pb_module {$this->main_css_element}.et_pb_slide .et_pb_slide_description .et_pb_slide_content",
'line_height' => "{$this->main_css_element} p",
'important' => 'all',
),
'line_height' => array(
'range_settings' => array(
'min' => '1',
'max' => '100',
'step' => '0.1',
),
),
'block_elements' => array(
'tabbed_subtoggles' => true,
'bb_icons_support' => true,
),
),
),
'button' => array(
'button' => array(
'label' => et_builder_i18n( 'Button' ),
'css' => array(
'main' => ".et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_more_button.et_pb_button",
'limited_main' => ".et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_more_button.et_pb_button",
'alignment' => ".et_pb_slider {$this->main_css_element} .et_pb_slide_description .et_pb_button_wrapper",
),
'use_alignment' => true,
'box_shadow' => array(
'css' => array(
'main' => '%%order_class%% .et_pb_button',
'important' => true,
),
),
'margin_padding' => array(
'css' => array(
'important' => 'all',
),
),
),
),
'background' => array(
'css' => array(
'main' => '.et_pb_slider %%order_class%%',
),
'options' => array(
'background_color' => array(
'default' => et_builder_accent_color(),
'default_on_child' => true,
),
),
),
'borders' => array(
'default' => false,
'image' => array(
'css' => array(
'main' => array(
'border_radii' => '%%order_class%%.et_pb_slide .et_pb_slide_image img',
'border_styles' => '%%order_class%%.et_pb_slide .et_pb_slide_image img',
),
),
'label_prefix' => et_builder_i18n( 'Image' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'depends_show_if' => 'off',
'defaults' => array(
'border_radii' => 'on||||',
'border_styles' => array(
'width' => '0px',
'color' => '#333333',
'style' => 'solid',
),
),
),
),
'margin_padding' => array(
'use_margin' => false,
'css' => array(
'padding' => '.et_pb_slider %%order_class%% .et_pb_slide_description, .et_pb_slider_fullwidth_off %%order_class%% .et_pb_slide_description',
'important' => array( 'custom_padding' ), // Important is needed to overwrite parent and column-specific padding specificity
),
),
'text' => array(
'use_background_layout' => true,
'css' => array(
'main' => implode(
', ',
array(
'%%order_class%% .et_pb_slide_description .et_pb_slide_title',
'%%order_class%% .et_pb_slide_description .et_pb_slide_title a',
'%%order_class%% .et_pb_slide_description .et_pb_slide_content',
'%%order_class%% .et_pb_slide_description .et_pb_slide_content .post-meta',
'%%order_class%% .et_pb_slide_description .et_pb_slide_content .post-meta a',
'%%order_class%% .et_pb_slide_description .et_pb_slide_content .et_pb_button',
)
),
'text_orientation' => '.et_pb_slides %%order_class%%.et_pb_slide .et_pb_slide_description',
'text_shadow' => '.et_pb_slides %%order_class%%.et_pb_slide .et_pb_slide_description',
),
'options' => array(
'background_layout' => array(
'default' => 'dark',
'default_on_child' => true,
'hover' => 'tabs',
),
),
),
'box_shadow' => array(
'default' => false,
'image' => array(
'label' => esc_html__( 'Image Box Shadow', 'et_builder' ),
'option_category' => 'layout',
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'css' => array(
'main' => '%%order_class%%.et_pb_slide .et_pb_slide_image img',
),
'default_on_fronts' => array(
'color' => '',
'position' => '',
),
),
),
'filters' => array(
'child_filters_target' => array(
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
),
),
'image' => array(
'css' => array(
'main' => array(
'%%order_class%% .et_pb_slide_image',
'%%order_class%% .et_pb_section_video_bg',
),
),
),
'max_width' => array(
'use_module_alignment' => false,
'css' => array(
'main' => '.et_pb_slider %%order_class%%.et_pb_slide > .et_pb_container',
),
'options' => array(
'width' => array(
'label' => esc_html__( 'Content Width', 'et_builder' ),
),
'max_width' => array(
'label' => esc_html__( 'Content Max Width', 'et_builder' ),
),
),
),
'height' => false,
'scroll_effects' => false,
'position_fields' => false,
'sticky' => false,
);
$this->custom_css_fields = array(
'slide_title' => array(
'label' => esc_html__( 'Slide Title', 'et_builder' ),
'selector' => '.et_pb_slide_description .et_pb_slide_title',
),
'slide_container' => array(
'label' => esc_html__( 'Slide Description Container', 'et_builder' ),
'selector' => '.et_pb_container',
),
'slide_description' => array(
'label' => esc_html__( 'Slide Description', 'et_builder' ),
'selector' => '.et_pb_slide_description',
),
'slide_button' => array(
'label' => esc_html__( 'Slide Button', 'et_builder' ),
'selector' => '.et_pb_slide .et_pb_container a.et_pb_more_button.et_pb_button',
'no_space_before_selector' => true,
),
'slide_image' => array(
'label' => esc_html__( 'Slide Image', 'et_builder' ),
'selector' => '.et_pb_slide_image',
),
);
$this->help_videos = array(
array(
'id' => '-YeoR2xSLOY',
'name' => esc_html__( 'An introduction to the Slider module', 'et_builder' ),
),
);
}
function get_fields() {
$fields = array(
'heading' => array(
'label' => et_builder_i18n( 'Title' ),
'type' => 'text',
'option_category' => 'basic_option',
'description' => esc_html__( 'Define the title text for your slide.', 'et_builder' ),
'toggle_slug' => 'main_content',
'dynamic_content' => 'text',
'mobile_options' => true,
'hover' => 'tabs',
),
'button_text' => array(
'label' => et_builder_i18n( 'Button' ),
'type' => 'text',
'option_category' => 'basic_option',
'description' => esc_html__( 'Define the text for the slide button', 'et_builder' ),
'toggle_slug' => 'main_content',
'dynamic_content' => 'text',
'mobile_options' => true,
'hover' => 'tabs',
),
'button_link' => array(
'label' => esc_html__( 'Button Link URL', 'et_builder' ),
'type' => 'text',
'option_category' => 'basic_option',
'description' => esc_html__( 'Input a destination URL for the slide button.', 'et_builder' ),
'toggle_slug' => 'link_options',
'default_on_front' => '#',
'dynamic_content' => 'url',
),
'url_new_window' => array(
'label' => esc_html__( 'Button Link Target', 'et_builder' ),
'type' => 'select',
'option_category' => 'configuration',
'options' => array(
'off' => esc_html__( 'In The Same Window', 'et_builder' ),
'on' => esc_html__( 'In The New Tab', 'et_builder' ),
),
'toggle_slug' => 'link_options',
'description' => esc_html__( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ),
'default_on_front' => 'off',
),
'image' => array(
'label' => et_builder_i18n( 'Image' ),
'type' => 'upload',
'option_category' => 'configuration',
'upload_button_text' => et_builder_i18n( 'Upload an image' ),
'choose_text' => esc_attr__( 'Choose a Slide Image', 'et_builder' ),
'update_text' => esc_attr__( 'Set As Slide Image', 'et_builder' ),
'affects' => array(
'image_alt',
),
'description' => esc_html__( 'If defined, this slide image will appear to the left of your slide text. Upload an image, or leave blank for a text-only slide.', 'et_builder' ),
'toggle_slug' => 'image_video',
'dynamic_content' => 'image',
'mobile_options' => true,
'hover' => 'tabs',
),
'use_bg_overlay' => array(
'label' => esc_html__( 'Use Background Overlay', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'options' => array(
'off' => et_builder_i18n( 'No' ),
// Uses cached uppercase translation but keeps the lowercase not change definition content.
'on' => strtolower( et_builder_i18n( 'Yes' ) ),
),
'affects' => array(
'bg_overlay_color',
),
'default_on_front' => '',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'When enabled, a custom overlay color will be added above your background image and behind your slider content.', 'et_builder' ),
),
'bg_overlay_color' => array(
'label' => esc_html__( 'Background Overlay Color', 'et_builder' ),
'type' => 'color-alpha',
'custom_color' => true,
'depends_show_if' => 'on',
'description' => esc_html__( 'Use the color picker to choose a color for the background overlay.', 'et_builder' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'mobile_options' => true,
'sticky' => true,
),
'use_text_overlay' => array(
'label' => esc_html__( 'Use Text Overlay', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'options' => array(
'off' => et_builder_i18n( 'No' ),
// Uses cached uppercase translation but keeps the lowercase not change definition content.
'on' => strtolower( et_builder_i18n( 'Yes' ) ),
),
'default_on_front' => '',
'affects' => array(
'text_overlay_color',
'text_border_radius',
),
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'When enabled, a background color is added behind the slider text to make it more readable atop background images.', 'et_builder' ),
),
'text_overlay_color' => array(
'label' => esc_html__( 'Text Overlay Color', 'et_builder' ),
'type' => 'color-alpha',
'custom_color' => true,
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'description' => esc_html__( 'Use the color picker to choose a color for the text overlay.', 'et_builder' ),
'mobile_options' => true,
'sticky' => true,
),
'alignment' => array(
'label' => esc_html__( 'Image Alignment', 'et_builder' ),
'type' => 'select',
'option_category' => 'layout',
'options' => array(
'center' => et_builder_i18n( 'Center' ),
'bottom' => et_builder_i18n( 'Bottom' ),
),
'default_on_front' => 'center',
'tab_slug' => 'advanced',
'toggle_slug' => 'image',
'description' => esc_html__( 'This setting determines the vertical alignment of your slide image. Your image can either be vertically centered, or aligned to the bottom of your slide.', 'et_builder' ),
),
'video_url' => array(
'label' => esc_html__( 'Video', 'et_builder' ),
'type' => 'upload',
'data_type' => 'video',
'upload_button_text' => esc_attr__( 'Upload a video', 'et_builder' ),
'choose_text' => esc_attr__( 'Choose a Video WEBM File', 'et_builder' ),
'update_text' => esc_attr__( 'Set As Video', 'et_builder' ),
'option_category' => 'basic_option',
'description' => esc_html__( 'If defined, this video will appear to the left of your slide text. Enter youtube or vimeo page url, or leave blank for a text-only slide.', 'et_builder' ),
'toggle_slug' => 'image_video',
'computed_affects' => array(
'__video_embed',
),
'mobile_options' => true,
'hover' => 'tabs',
),
'image_alt' => array(
'label' => esc_html__( 'Image Alternative Text', 'et_builder' ),
'type' => 'text',
'option_category' => 'basic_option',
'depends_show_if' => 'on',
'depends_on' => array(
'image',
),
'description' => esc_html__( 'If you have a slide image defined, input your HTML ALT text for the image here.', 'et_builder' ),
'tab_slug' => 'custom_css',
'toggle_slug' => 'attributes',
'dynamic_content' => 'text',
),
'allow_player_pause' => array(
'label' => esc_html__( 'Pause Video When Another Video Plays', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'options' => array(
'off' => et_builder_i18n( 'No' ),
'on' => et_builder_i18n( 'Yes' ),
),
'default_on_front' => '',
'toggle_slug' => 'player_pause',
'description' => esc_html__( 'Allow video to be paused by other players when they begin playing', 'et_builder' ),
),
'content' => array(
'label' => et_builder_i18n( 'Body' ),
'type' => 'tiny_mce',
'option_category' => 'basic_option',
'description' => esc_html__( 'Input your main slide text content here.', 'et_builder' ),
'toggle_slug' => 'main_content',
'dynamic_content' => 'text',
'mobile_options' => true,
'hover' => 'tabs',
),
'arrows_custom_color' => array(
'label' => esc_html__( 'Arrow Color', 'et_builder' ),
'description' => esc_html__( 'Pick a color to use for the slider arrows that are used to navigate through each slide.', 'et_builder' ),
'type' => 'color-alpha',
'custom_color' => true,
'tab_slug' => 'advanced',
'toggle_slug' => 'navigation',
'mobile_options' => true,
'sticky' => true,
'hover' => 'tabs',
),
'dot_nav_custom_color' => array(
'label' => esc_html__( 'Dot Navigation Color', 'et_builder' ),
'description' => esc_html__( 'Pick a color to use for the dot navigation that appears at the bottom of the slider to designate which slide is active.', 'et_builder' ),
'type' => 'color-alpha',
'custom_color' => true,
'tab_slug' => 'advanced',
'toggle_slug' => 'navigation',
'mobile_options' => true,
'sticky' => true,
'hover' => 'tabs',
),
'admin_title' => array(
'label' => et_builder_i18n( 'Admin Label' ),
'type' => 'text',
'description' => esc_html__( 'This will change the label of the slide in the builder for easy identification.', 'et_builder' ),
'toggle_slug' => 'admin_label',
),
'text_border_radius' => array(
'label' => esc_html__( 'Text Overlay Border Radius', 'et_builder' ),
'description' => esc_html__( 'Increasing the border radius will increase the roundness of the overlay corners. Setting this value to 0 will result in squared corners.', 'et_builder' ),
'type' => 'range',
'option_category' => 'layout',
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'default' => '3',
'default_unit' => 'px',
'default_on_front' => '',
'range_settings' => array(
'min' => '0',
'max' => '100',
'step' => '1',
),
'depends_show_if' => 'on',
'tab_slug' => 'advanced',
'toggle_slug' => 'overlay',
'mobile_options' => true,
'sticky' => true,
),
'__video_embed' => array(
'type' => 'computed',
'computed_callback' => array( 'ET_Builder_Module_Slider_Item', 'get_video_embed' ),
'computed_depends_on' => array(
'video_url',
),
'computed_minimum' => array(
'video_url',
),
),
);
return $fields;
}
public function get_transition_fields_css_props() {
$fields = parent::get_transition_fields_css_props();
$fields['background_layout'] = array(
'background-color' => '%%order_class%% .et_pb_slide_overlay_container, %%order_class%% .et_pb_text_overlay_wrapper',
'color' => self::$_->array_get( $this->advanced_fields, 'text.css.main', '%%order_class%%' ),
);
$fields['bg_overlay_color'] = array( 'background-color' => '%%order_class%%.et_pb_slide .et_pb_slide_overlay_container' );
$fields['text_overlay_color'] = array( 'background-color' => '%%order_class%%.et_pb_slide .et_pb_text_overlay_wrapper' );
$fields['text_border_radius'] = array( 'border-radius' => '%%order_class%%.et_pb_slide .et_pb_text_overlay_wrapper' );
$fields['dot_nav_custom_color'] = array( 'background-color' => et_pb_slider_options()->get_dots_selector() );
$fields['arrows_custom_color'] = array( 'all' => et_pb_slider_options()->get_arrows_selector() );
return $fields;
}
static function get_video_embed( $args = array(), $conditonal_args = array(), $current_page = array() ) {
global $wp_embed;
$video_url = esc_url( $args['video_url'] );
// Bail early if video URL is empty.
if ( empty( $video_url ) ) {
return '';
}
$autoembed = $wp_embed->autoembed( $video_url );
$is_local_video = has_shortcode( $autoembed, 'video' );
$video_embed = '';
if ( $is_local_video ) {
$video_embed = wp_video_shortcode( array( 'src' => $video_url ) );
} else {
$video_embed = et_builder_get_oembed( $video_url );
$video_embed = preg_replace( '/