name = __( 'Image', 'et_builder' ); $this->slug = 'et_pb_image'; $this->whitelisted_fields = array( 'src', 'alt', 'title_text', 'show_in_lightbox', 'url', 'url_new_window', 'animation', 'sticky', 'align', 'admin_label', 'module_id', 'module_class', 'max_width', 'force_fullwidth', 'always_center_on_mobile', ); $this->fields_defaults = array( 'show_in_lightbox' => array( 'off' ), 'url_new_window' => array( 'off' ), 'animation' => array( 'left' ), 'sticky' => array( 'off' ), 'align' => array( 'left' ), 'force_fullwidth' => array( 'off' ), 'always_center_on_mobile' => array( 'on' ), ); $this->advanced_options = array( 'border' => array(), 'custom_margin_padding' => array( 'use_padding' => false, 'css' => array( 'important' => 'all', ), ), ); } function get_fields() { // List of animation options $animation_options_list = array( 'left' => __( 'Left To Right', 'et_builder' ), 'right' => __( 'Right To Left', 'et_builder' ), 'top' => __( 'Top To Bottom', 'et_builder' ), 'bottom' => __( 'Bottom To Top', 'et_builder' ), 'fade_in' => __( 'Fade In', 'et_builder' ), 'off' => __( 'No Animation', 'et_builder' ), ); $animation_option_name = sprintf( '%1$s-animation', $this->slug ); $default_animation_direction = ET_Global_Settings::get_value( $animation_option_name ); // If user modifies default animation option via Customizer, we'll need to change the order if ( 'left' !== $default_animation_direction && array_key_exists( $default_animation_direction, $animation_options_list ) ) { // The options, sans user's preferred direction $animation_options_wo_default = $animation_options_list; unset( $animation_options_wo_default[ $default_animation_direction ] ); // All animation options $animation_options = array_merge( array( $default_animation_direction => $animation_options_list[$default_animation_direction] ), $animation_options_wo_default ); } else { // Simply copy the animation options $animation_options = $animation_options_list; } $fields = array( 'src' => array( 'label' => __( 'Image URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'description' => __( 'Upload your desired image, or type in the URL to the image you would like to display.', 'et_builder' ), ), 'alt' => array( 'label' => __( 'Image Alternative Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'This defines the HTML ALT text. A short description of your image can be placed here.', 'et_builder' ), ), 'title_text' => array( 'label' => __( 'Image Title Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'This defines the HTML Title text.', 'et_builder' ), ), 'show_in_lightbox' => array( 'label' => __( 'Open in Lightbox', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( "No", 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_url', '#et_pb_url_new_window', ), 'description' => __( 'Here you can choose whether or not the image should open in Lightbox. Note: if you select to open the image in Lightbox, url options below will be ignored.', 'et_builder' ), ), 'url' => array( 'label' => __( 'Link URL', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'depends_show_if' => 'off', 'description' => __( 'If you would like your image to be a link, input your destination URL here. No link will be created if this field is left blank.', 'et_builder' ), ), 'url_new_window' => array( 'label' => __( 'Url Opens', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'In The Same Window', 'et_builder' ), 'on' => __( 'In The New Tab', 'et_builder' ), ), 'depends_show_if' => 'off', 'description' => __( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ), ), 'animation' => array( 'label' => __( 'Animation', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => $animation_options, 'description' => __( 'This controls the direction of the lazy-loading animation.', 'et_builder' ), ), 'sticky' => array( 'label' => __( 'Remove Space Below The Image', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'description' => __( 'Here you can choose whether or not the image should have a space below it.', 'et_builder' ), ), 'align' => array( 'label' => __( 'Image Alignment', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'left' => __( 'Left', 'et_builder' ), 'center' => __( 'Center', 'et_builder' ), 'right' => __( 'Right', 'et_builder' ), ), 'description' => __( 'Here you can choose the image alignment.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'max_width' => array( 'label' => __( 'Image Max Width', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), 'force_fullwidth' => array( 'label' => __( 'Force Fullwidth', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( "No", 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', ), 'always_center_on_mobile' => array( 'label' => __( 'Always Center Image On Mobile', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( "No", 'et_builder' ), ), 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $src = $this->shortcode_atts['src']; $alt = $this->shortcode_atts['alt']; $title_text = $this->shortcode_atts['title_text']; $animation = $this->shortcode_atts['animation']; $url = $this->shortcode_atts['url']; $url_new_window = $this->shortcode_atts['url_new_window']; $show_in_lightbox = $this->shortcode_atts['show_in_lightbox']; $sticky = $this->shortcode_atts['sticky']; $align = $this->shortcode_atts['align']; $max_width = $this->shortcode_atts['max_width']; $force_fullwidth = $this->shortcode_atts['force_fullwidth']; $always_center_on_mobile = $this->shortcode_atts['always_center_on_mobile']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( 'on' === $always_center_on_mobile ) { $module_class .= ' et_always_center_on_mobile'; } if ( '' !== $max_width ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%', 'declaration' => sprintf( 'max-width: %1$s;', esc_html( et_builder_process_range_value( $max_width ) ) ), ) ); } if ( 'on' === $force_fullwidth ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% img', 'declaration' => 'width: 100%;', ) ); } if ( $this->fields_defaults['align'][0] !== $align ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%', 'declaration' => sprintf( 'text-align: %1$s;', esc_html( $align ) ), ) ); } $output = sprintf( '%2$s', esc_attr( $src ), esc_attr( $alt ), ( '' !== $title_text ? sprintf( ' title="%1$s"', esc_attr( $title_text ) ) : '' ) ); if ( 'on' === $show_in_lightbox ) { $output = sprintf( '%2$s', esc_url( $src ), $output, esc_attr( $alt ) ); } else if ( '' !== $url ) { $output = sprintf( '%2$s', esc_url( $url ), $output, ( 'on' === $url_new_window ? ' target="_blank"' : '' ) ); } $animation = '' === $animation ? ET_Global_Settings::get_value( 'et_pb_image-animation' ) : $animation; $output = sprintf( ' %1$s ', $output, esc_attr( " et_pb_animation_{$animation}" ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( ltrim( $module_class ) ) ) : '' ), ( 'on' === $sticky ? esc_attr( ' et_pb_image_sticky' ) : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ) ); return $output; } } new ET_Builder_Module_Image; class ET_Builder_Module_Gallery extends ET_Builder_Module { function init() { $this->name = __( 'Gallery', 'et_builder' ); $this->slug = 'et_pb_gallery'; $this->whitelisted_fields = array( 'src', 'gallery_ids', 'gallery_orderby', 'fullwidth', 'posts_number', 'show_title_and_caption', 'show_pagination', 'background_layout', 'auto', 'auto_speed', 'admin_label', 'module_id', 'module_class', 'zoom_icon_color', 'hover_overlay_color', 'hover_icon', ); $this->fields_defaults = array( 'fullwidth' => array( 'off' ), 'posts_number' => array( 4, 'add_default_setting' ), 'show_title_and_caption' => array( 'on' ), 'show_pagination' => array( 'on' ), 'background_layout' => array( 'light' ), 'auto' => array( 'off' ), 'auto_speed' => array( '7000' ), ); $this->main_css_element = '%%order_class%%.et_pb_gallery'; $this->advanced_options = array( 'fonts' => array( 'caption' => array( 'label' => __( 'Caption', 'et_builder' ), 'use_all_caps' => true, 'css' => array( 'main' => "{$this->main_css_element} .mfp-title", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_gallery_title", ), ), ), 'border' => array(), ); $this->custom_css_options = array( 'gallery_item' => array( 'label' => __( 'Gallery Item', 'et_builder' ), 'selector' => '.et_pb_gallery_item', ), 'overlay' => array( 'label' => __( 'Overlay', 'et_builder' ), 'selector' => '.et_overlay', ), 'overlay_icon' => array( 'label' => __( 'Overlay Icon', 'et_builder' ), 'selector' => '.et_overlay:before', ), 'gallery_item_title' => array( 'label' => __( 'Gallery Item Title', 'et_builder' ), 'selector' => '.et_pb_gallery_title', ), ); } function get_fields() { $fields = array( 'src' => array( 'label' => __( 'Gallery Images', 'et_builder' ), 'renderer' => 'et_builder_get_gallery_settings', 'option_category' => 'basic_option', ), 'gallery_ids' => array( 'type' => 'hidden', 'class' => array( 'et-pb-gallery-ids-field' ), ), 'gallery_orderby' => array( 'label' => __( 'Gallery Images', 'et_builder' ), 'type' => 'hidden', 'class' => array( 'et-pb-gallery-ids-field' ), ), 'fullwidth' => array( 'label' => __( 'Layout', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'on' => __( 'Slider', 'et_builder' ), 'off' => __( 'Grid', 'et_builder' ), ), 'description' => __( 'Toggle between the various blog layout types.', 'et_builder' ), 'affects' => array( '#et_pb_zoom_icon_color', '#et_pb_caption_font', '#et_pb_caption_font_color', '#et_pb_caption_font_size', '#et_pb_hover_overlay_color', '#et_pb_auto', ), ), 'posts_number' => array( 'label' => __( 'Images Number', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Define the number of images that should be displayed per page.', 'et_builder' ), ), 'show_title_and_caption' => array( 'label' => __( 'Show Title and Caption', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'description' => __( 'Here you can choose whether to show the images title and caption, if the image has them.', 'et_builder' ), ), 'show_pagination' => array( 'label' => __( 'Show Pagination', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'description' => __( 'Enable or disable pagination for this feed.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'light' => __( 'Dark', 'et_builder' ), 'dark' => __( 'Light', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'auto' => array( 'label' => __( 'Automatic Animation', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'Off', 'et_builder' ), 'on' => __( 'On', 'et_builder' ), ), 'affects' => array( '#et_pb_auto_speed', ), 'depends_show_if' => 'on', 'description' => __( 'If you would like the slider to slide automatically, without the visitor having to click the next button, enable this option and then adjust the rotation speed below if desired.', 'et_builder' ), ), 'auto_speed' => array( 'label' => __( 'Automatic Animation Speed (in ms)', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'depends_default' => true, 'description' => __( "Here you can designate how fast the slider fades between each slide, if 'Automatic Animation' option is enabled above. The higher the number the longer the pause between each rotation.", 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'zoom_icon_color' => array( 'label' => __( 'Zoom Icon Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'depends_show_if' => 'off', 'tab_slug' => 'advanced', ), 'hover_overlay_color' => array( 'label' => __( 'Hover Overlay Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'depends_show_if' => 'off', 'tab_slug' => 'advanced', ), 'hover_icon' => array( 'label' => __( 'Hover Icon Picker', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'class' => array( 'et-pb-font-icon' ), 'renderer' => 'et_pb_get_font_icon_list', 'renderer_with_field' => true, 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $gallery_ids = $this->shortcode_atts['gallery_ids']; $fullwidth = $this->shortcode_atts['fullwidth']; $show_title_and_caption = $this->shortcode_atts['show_title_and_caption']; $background_layout = $this->shortcode_atts['background_layout']; $posts_number = $this->shortcode_atts['posts_number']; $show_pagination = $this->shortcode_atts['show_pagination']; $gallery_orderby = $this->shortcode_atts['gallery_orderby']; $zoom_icon_color = $this->shortcode_atts['zoom_icon_color']; $hover_overlay_color = $this->shortcode_atts['hover_overlay_color']; $hover_icon = $this->shortcode_atts['hover_icon']; $auto = $this->shortcode_atts['auto']; $auto_speed = $this->shortcode_atts['auto_speed']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $zoom_icon_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_overlay:before', 'declaration' => sprintf( 'color: %1$s !important;', esc_html( $zoom_icon_color ) ), ) ); } if ( '' !== $hover_overlay_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_overlay', 'declaration' => sprintf( 'background-color: %1$s; border-color: %1$s;', esc_html( $hover_overlay_color ) ), ) ); } $attachments = array(); if ( ! empty( $gallery_ids ) ) { $attachments_args = array( 'include' => $gallery_ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'post__in', ); if ( 'rand' === $gallery_orderby ) { $attachments_args['orderby'] = 'rand'; } $_attachments = get_posts( $attachments_args ); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } if ( empty($attachments) ) return ''; wp_enqueue_script( 'hashchange' ); $fullwidth_class = 'on' === $fullwidth ? ' et_pb_slider et_pb_gallery_fullwidth' : ' et_pb_gallery_grid'; $background_class = " et_pb_bg_layout_{$background_layout}"; $module_class .= 'on' === $auto && 'on' === $fullwidth ? ' et_slider_auto et_slider_speed_' . esc_attr( $auto_speed ) : ''; $output = sprintf( '
', ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( ltrim( $module_class ) ) ) : '' ), esc_attr( $fullwidth_class ), esc_attr( $background_class ), esc_attr( $posts_number ) ); $i = 0; foreach ( $attachments as $id => $attachment ) { $width = 'on' === $fullwidth ? 1080 : 400; $width = (int) apply_filters( 'et_pb_gallery_image_width', $width ); $height = 'on' === $fullwidth ? 9999 : 284; $height = (int) apply_filters( 'et_pb_gallery_image_height', $height ); list($full_src, $full_width, $full_height) = wp_get_attachment_image_src( $id, 'full' ); list($thumb_src, $thumb_width, $thumb_height) = wp_get_attachment_image_src( $id, array( $width, $height ) ); $data_icon = '' !== $hover_icon ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $hover_icon ) ) ) : ''; $image_output = sprintf( ' %2$s ', esc_attr( $full_src ), esc_attr( $attachment->post_title ), esc_attr( $thumb_src ), ( '' !== $hover_icon ? ' et_pb_inline_icon' : '' ), $data_icon ); $orientation = ( $thumb_height > $thumb_width ) ? 'portrait' : 'landscape'; $output .= sprintf( '"; } $output .= "
"; if ( 'on' !== $fullwidth && 'on' === $show_pagination ) { $output .= ""; } $output .= ""; return $output; } } new ET_Builder_Module_Gallery; class ET_Builder_Module_Video extends ET_Builder_Module { function init() { $this->name = __( 'Video', 'et_builder' ); $this->slug = 'et_pb_video'; $this->whitelisted_fields = array( 'src', 'src_webm', 'image_src', 'play_icon_color', 'admin_label', 'module_id', 'module_class', ); $this->custom_css_options = array( 'video_icon' => array( 'label' => __( 'Video Icon', 'et_builder' ), 'selector' => '.et_pb_video_play', ), ); } function get_fields() { $fields = array( 'src' => array( 'label' => __( 'Video MP4/URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Video MP4 File', 'et_builder' ), 'update_text' => __( 'Set As Video', 'et_builder' ), 'description' => __( 'Upload your desired video in .MP4 format, or type in the URL to the video you would like to display', 'et_builder' ), ), 'src_webm' => array( 'label' => __( 'Video Webm', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Video WEBM File', 'et_builder' ), 'update_text' => __( 'Set As Video', 'et_builder' ), 'description' => __( 'Upload the .WEBM version of your video here. All uploaded videos should be in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers.', 'et_builder' ), ), 'image_src' => array( 'label' => __( 'Image Overlay URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'additional_button' => sprintf( '', esc_attr__( 'Generate From Video', 'et_builder' ) ), 'classes' => 'et_pb_video_overlay', 'description' => __( 'Upload your desired image, or type in the URL to the image you would like to display over your video. You can also generate a still image from your video.', 'et_builder' ), ), 'play_icon_color' => array( 'label' => __( 'Play Icon Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $src = $this->shortcode_atts['src']; $src_webm = $this->shortcode_atts['src_webm']; $image_src = $this->shortcode_atts['image_src']; $play_icon_color = $this->shortcode_atts['play_icon_color']; $video_src = ''; if ( '' !== $image_src ) { $image_output = $image_src; } else { $image_output = ''; } $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $play_icon_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_video_play', 'declaration' => sprintf( 'color: %1$s;', esc_html( $play_icon_color ) ), ) ); } if ( '' !== $src ) { if ( false !== et_pb_check_oembed_provider( esc_url( $src ) ) ) { $video_src = wp_oembed_get( esc_url( $src ) ); } else { $video_src = sprintf( ' ', ( '' !== $src ? sprintf( '', esc_url( $src ) ) : '' ), ( '' !== $src_webm ? sprintf( '', esc_url( $src_webm ) ) : '' ) ); wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'wp-mediaelement' ); } } $output = sprintf( '
%1$s
%4$s ', ( '' !== $video_src ? $video_src : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ), ( '' !== $image_output ? sprintf( '
', esc_attr( $image_output ) ) : '' ) ); return $output; } } new ET_Builder_Module_Video; class ET_Builder_Module_Video_Slider extends ET_Builder_Module { function init() { $this->name = __( 'Video Slider', 'et_builder' ); $this->slug = 'et_pb_video_slider'; $this->child_slug = 'et_pb_video_slider_item'; $this->child_item_text = __( 'Video', 'et_builder' ); $this->whitelisted_fields = array( 'show_image_overlay', 'show_arrows', 'show_thumbnails', 'controls_color', 'admin_label', 'module_id', 'module_class', 'play_icon_color', 'thumbnail_overlay_color', ); $this->fields_defaults = array( 'show_image_overlay' => array( 'hide' ), 'show_arrows' => array( 'on' ), 'show_thumbnails' => array( 'on' ), ); $this->custom_css_options = array( 'play_button' => array( 'label' => __( 'Play Button', 'et_builder' ), 'selector' => '.et_pb_video_play', ), 'thumbnail_item' => array( 'label' => __( 'Thumbnail Item', 'et_builder' ), 'selector' => '.et_pb_carousel_item', ), ); } function get_fields() { $fields = array( 'show_image_overlay' => array( 'label' => __( 'Display Image Overlays on Main Video', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'hide' => __( 'Hide', 'et_builder' ), 'show' => __( 'Show', 'et_builder' ), ), 'description' => __( 'This option will cover the player UI on the main video. This image can either be uploaded in each video setting or auto-generated by Divi.', 'et_builder' ), ), 'show_arrows' => array( 'label' => __( 'Arrows', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Show Arrows', 'et_builder' ), 'off' => __( 'Hide Arrows', 'et_builder' ), ), 'description' => __( 'This setting will turn on and off the navigation arrows.', 'et_builder' ), ), 'show_thumbnails' => array( 'label' => __( 'Slider Controls', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Use Thumbnail Track', 'et_builder' ), 'off' => __( 'Use Dot Navigation', 'et_builder' ), ), 'description' => __( 'This setting will let you choose to use the thumbnail track controls below the slider or dot navigation at the bottom of the slider.', 'et_builder' ), ), 'controls_color' => array( 'label' => __( 'Slider Controls Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'light' => __( 'Light', 'et_builder' ), 'dark' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'This setting will make your slider controls either light or dark in color. Slider controls are either the arrows on the thumbnail track or the circles in dot navigation.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'play_icon_color' => array( 'label' => __( 'Play Icon Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'thumbnail_overlay_color' => array( 'label' => __( 'Thumbnail Overlay Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), ); return $fields; } function pre_shortcode_content() { global $et_pb_slider_image_overlay; $show_image_overlay = $this->shortcode_atts['show_image_overlay']; $et_pb_slider_image_overlay = $show_image_overlay; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $show_arrows = $this->shortcode_atts['show_arrows']; $show_thumbnails = $this->shortcode_atts['show_thumbnails']; $controls_color = $this->shortcode_atts['controls_color']; $play_icon_color = $this->shortcode_atts['play_icon_color']; $thumbnail_overlay_color = $this->shortcode_atts['thumbnail_overlay_color']; global $et_pb_slider_image_overlay; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $play_icon_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_video_play, %%order_class%% .et_pb_carousel .et_pb_video_play', 'declaration' => sprintf( 'color: %1$s !important;', esc_html( $play_icon_color ) ), ) ); } if ( '' !== $thumbnail_overlay_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_carousel_item .et_pb_video_overlay_hover:hover, %%order_class%%.et_pb_video_slider .et_pb_slider:hover .et_pb_video_overlay_hover, %%order_class%% .et_pb_carousel_item.et-pb-active-control .et_pb_video_overlay_hover', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $thumbnail_overlay_color ) ), ) ); } $class = ''; $class .= 'off' === $show_arrows ? ' et_pb_slider_no_arrows' : ''; $class .= 'on' === $show_thumbnails ? ' et_pb_slider_carousel et_pb_slider_no_pagination' : ''; $class .= 'off' === $show_thumbnails ? ' et_pb_slider_dots' : ''; $class .= " et_pb_controls_{$controls_color}"; $content = $this->shortcode_content; $output = sprintf( '
%2$s
', esc_attr( $class ), $content, ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ) ); return $output; } } new ET_Builder_Module_Video_Slider; class ET_Builder_Module_Video_Slider_Item extends ET_Builder_Module { function init() { $this->name = __( 'Video', 'et_builder' ); $this->slug = 'et_pb_video_slider_item'; $this->type = 'child'; $this->child_title_var = 'admin_title'; $this->advanced_setting_title_text = __( 'New Video', 'et_builder' ); $this->settings_text = __( 'Video Settings', 'et_builder' ); $this->whitelisted_fields = array( 'admin_title', 'src', 'src_webm', 'image_src', 'background_layout', ); $this->fields_defaults = array( 'background_layout' => array( 'dark' ), ); } function get_fields() { $fields = array( 'admin_title' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the video in the builder for easy identification.', 'et_builder' ), ), 'src' => array( 'label' => __( 'Video MP4/URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Video MP4 File', 'et_builder' ), 'update_text' => __( 'Set As Video', 'et_builder' ), 'description' => __( 'Upload your desired video in .MP4 format, or type in the URL to the video you would like to display', 'et_builder' ), ), 'src_webm' => array( 'label' => __( 'Video Webm', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Video WEBM File', 'et_builder' ), 'update_text' => __( 'Set As Video', 'et_builder' ), 'description' => __( 'Upload the .WEBM version of your video here. All uploaded videos should be in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers.', 'et_builder' ), ), 'image_src' => array( 'label' => __( 'Image Overlay URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'additional_button' => sprintf( '', esc_attr__( 'Generate From Video', 'et_builder' ) ), 'classes' => 'et_pb_video_overlay', 'description' => __( 'Upload your desired image, or type in the URL to the image you would like to display over your video. You can also generate a still image from your video.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Slider Arrows Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'This setting will make your slider arrows either light or dark in color.', 'et_builder' ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $src = $this->shortcode_atts['src']; $src_webm = $this->shortcode_atts['src_webm']; $image_src = $this->shortcode_atts['image_src']; $background_layout = $this->shortcode_atts['background_layout']; $video_src = ''; global $et_pb_slider_image_overlay; $class = ''; $class .= " et_pb_bg_layout_{$background_layout}"; if ( '' !== $image_src ) { $image_overlay_output = $image_src; $thumbnail_track_output = $image_src; } else { $image_overlay_output = ''; if ( false !== et_pb_check_oembed_provider( esc_url( $src ) ) ) { add_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 ); // Save thumbnail $thumbnail_track_output = wp_oembed_get( esc_url( $src ) ); // Set back to normal remove_filter( 'oembed_dataparse', 'et_pb_video_oembed_data_parse', 10, 3 ); } else { $thumbnail_track_output = ''; } } if ( '' !== $src ) { if ( false !== et_pb_check_oembed_provider( esc_url( $src ) ) ) { $video_src = wp_oembed_get( esc_url( $src ) ); } else { $video_src = sprintf( ' ', ( '' !== $src ? sprintf( '', esc_url( $src ) ) : '' ), ( '' !== $src_webm ? sprintf( '', esc_url( $src_webm ) ) : '' ) ); wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'wp-mediaelement' ); } } $video_output = sprintf( '
%1$s
%2$s
', ( '' !== $video_src ? $video_src : '' ), ( ( '' !== $image_overlay_output && $et_pb_slider_image_overlay == 'show' ) ? sprintf( '
', esc_attr( $image_overlay_output ) ) : '' ) ); $output = sprintf( '
%2$s
', esc_attr( $class ), ( '' !== $video_output ? $video_output : '' ), ( '' !== $thumbnail_track_output ? sprintf( ' data-image="%1$s"', esc_attr( $thumbnail_track_output ) ) : '' ) ); return $output; } } new ET_Builder_Module_Video_Slider_Item; class ET_Builder_Module_Text extends ET_Builder_Module { function init() { $this->name = __( 'Text', 'et_builder' ); $this->slug = 'et_pb_text'; $this->whitelisted_fields = array( 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'max_width', ); $this->fields_defaults = array( 'background_layout' => array( 'light' ), 'text_orientation' => array( 'left' ), ); $this->main_css_element = '%%order_class%%'; $this->advanced_options = array( 'fonts' => array( 'text' => array( 'label' => __( 'Text', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'settings' => array( 'color' => 'alpha', ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), ); } function get_fields() { $fields = array( 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'light' => __( 'Dark', 'et_builder' ), 'dark' => __( 'Light', 'et_builder' ), ), 'description' => __( 'Here you can choose the value of your text. If you are working with a dark background, then your text should be set to light. If you are working with a light background, then your text should be dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'This controls the how your text is aligned within the module.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Here you can create the content that will be used within the module.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'max_width' => array( 'label' => __( 'Max Width', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $background_layout = $this->shortcode_atts['background_layout']; $text_orientation = $this->shortcode_atts['text_orientation']; $max_width = $this->shortcode_atts['max_width']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); $this->shortcode_content = et_builder_replace_code_content_entities( $this->shortcode_content ); if ( '' !== $max_width ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%', 'declaration' => sprintf( 'max-width: %1$s;', esc_html( et_builder_process_range_value( $max_width ) ) ), ) ); } if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; $output = sprintf( ' %1$s ', $this->shortcode_content, esc_attr( $class ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ) ); return $output; } } new ET_Builder_Module_Text; class ET_Builder_Module_Blurb extends ET_Builder_Module { function init() { $this->name = __( 'Blurb', 'et_builder' ); $this->slug = 'et_pb_blurb'; $this->main_css_element = '%%order_class%%.et_pb_blurb'; $this->whitelisted_fields = array( 'title', 'url', 'url_new_window', 'use_icon', 'font_icon', 'icon_color', 'use_circle', 'circle_color', 'use_circle_border', 'circle_border_color', 'image', 'alt', 'icon_placement', 'animation', 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'max_width', 'use_icon_font_size', 'icon_font_size', ); $et_accent_color = et_builder_accent_color(); $this->fields_defaults = array( 'url_new_window' => array( 'off' ), 'use_icon' => array( 'off' ), 'icon_color' => array( $et_accent_color, 'add_default_setting' ), 'use_circle' => array( 'off' ), 'circle_color' => array( $et_accent_color, 'only_default_setting' ), 'use_circle_border' => array( 'off' ), 'circle_border_color' => array( $et_accent_color, 'only_default_setting' ), 'icon_placement' => array( 'top' ), 'animation' => array( 'top' ), 'background_layout' => array( 'light' ), 'text_orientation' => array( 'center' ), 'use_icon_font_size' => array( 'off' ), ); $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} h4, {$this->main_css_element} h4 a", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'settings' => array( 'color' => 'alpha', ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), ); $this->custom_css_options = array( 'blurb_image' => array( 'label' => __( 'Blurb Image', 'et_builder' ), 'selector' => '.et_pb_main_blurb_image', ), 'blurb_title' => array( 'label' => __( 'Blurb Title', 'et_builder' ), 'selector' => 'h4', ), 'blurb_content' => array( 'label' => __( 'Blurb Content', 'et_builder' ), 'selector' => '.et_pb_blurb_content', ), ); } function get_fields() { $et_accent_color = et_builder_accent_color(); $image_icon_placement = array( 'top' => __( 'Top', 'et_builder' ), ); if ( ! is_rtl() ) { $image_icon_placement['left'] = __( 'Left', 'et_builder' ); } else { $image_icon_placement['right'] = __( 'Right', 'et_builder' ); } $fields = array( 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'The title of your blurb will appear in bold below your blurb image.', 'et_builder' ), ), 'url' => array( 'label' => __( 'Url', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'If you would like to make your blurb a link, input your destination URL here.', 'et_builder' ), ), 'url_new_window' => array( 'label' => __( 'Url Opens', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'In The Same Window', 'et_builder' ), 'on' => __( 'In The New Tab', 'et_builder' ), ), 'description' => __( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ), ), 'use_icon' => array( 'label' => __( 'Use Icon', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'basic_option', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_font_icon', '#et_pb_use_circle', '#et_pb_icon_color', '#et_pb_image', '#et_pb_alt', ), 'description' => __( 'Here you can choose whether icon set below should be used.', 'et_builder' ), ), 'font_icon' => array( 'label' => __( 'Icon', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'class' => array( 'et-pb-font-icon' ), 'renderer' => 'et_pb_get_font_icon_list', 'renderer_with_field' => true, 'description' => __( 'Choose an icon to display with your blurb.', 'et_builder' ), 'depends_default' => true, ), 'icon_color' => array( 'label' => __( 'Icon Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Here you can define a custom color for your icon.', 'et_builder' ), 'depends_default' => true, ), 'use_circle' => array( 'label' => __( 'Circle Icon', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_use_circle_border', '#et_pb_circle_color', ), 'description' => __( 'Here you can choose whether icon set above should display within a circle.', 'et_builder' ), 'depends_default' => true, ), 'circle_color' => array( 'label' => __( 'Circle Color', 'et_builder' ), 'type' => 'color', 'description' => __( 'Here you can define a custom color for the icon circle.', 'et_builder' ), 'depends_default' => true, ), 'use_circle_border' => array( 'label' => __( 'Show Circle Border', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_circle_border_color', ), 'description' => __( 'Here you can choose whether if the icon circle border should display.', 'et_builder' ), 'depends_default' => true, ), 'circle_border_color' => array( 'label' => __( 'Circle Border Color', 'et_builder' ), 'type' => 'color', 'description' => __( 'Here you can define a custom color for the icon circle border.', 'et_builder' ), 'depends_default' => true, ), 'image' => array( 'label' => __( 'Image', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'depends_show_if' => 'off', 'description' => __( 'Upload an image to display at the top of your blurb.', 'et_builder' ), ), 'alt' => array( 'label' => __( 'Image Alt Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define the HTML ALT text for your image here.', 'et_builder' ), 'depends_show_if' => 'off', ), 'icon_placement' => array( 'label' => __( 'Image/Icon Placement', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => $image_icon_placement, 'description' => __( 'Here you can choose where to place the icon.', 'et_builder' ), ), 'animation' => array( 'label' => __( 'Image/Icon Animation', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'top' => __( 'Top To Bottom', 'et_builder' ), 'left' => __( 'Left To Right', 'et_builder' ), 'right' => __( 'Right To Left', 'et_builder' ), 'bottom' => __( 'Bottom To Top', 'et_builder' ), 'off' => __( 'No Animation', 'et_builder' ), ), 'description' => __( 'This controls the direction of the lazy-loading animation.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'light' => __( 'Dark', 'et_builder' ), 'dark' => __( 'Light', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'This will control how your blurb text is aligned.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input the main text content for your module here.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'max_width' => array( 'label' => __( 'Image Max Width', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), 'use_icon_font_size' => array( 'label' => __( 'Use Icon Font Size', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'font_option', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_icon_font_size', ), 'tab_slug' => 'advanced', ), 'icon_font_size' => array( 'label' => __( 'Icon Font Size', 'et_builder' ), 'type' => 'range', 'option_category' => 'font_option', 'tab_slug' => 'advanced', 'depends_default' => true, ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $title = $this->shortcode_atts['title']; $url = $this->shortcode_atts['url']; $image = $this->shortcode_atts['image']; $url_new_window = $this->shortcode_atts['url_new_window']; $alt = $this->shortcode_atts['alt']; $background_layout = $this->shortcode_atts['background_layout']; $text_orientation = $this->shortcode_atts['text_orientation']; $animation = $this->shortcode_atts['animation']; $icon_placement = $this->shortcode_atts['icon_placement']; $font_icon = $this->shortcode_atts['font_icon']; $use_icon = $this->shortcode_atts['use_icon']; $use_circle = $this->shortcode_atts['use_circle']; $use_circle_border = $this->shortcode_atts['use_circle_border']; $icon_color = $this->shortcode_atts['icon_color']; $circle_color = $this->shortcode_atts['circle_color']; $circle_border_color = $this->shortcode_atts['circle_border_color']; $max_width = $this->shortcode_atts['max_width']; $use_icon_font_size = $this->shortcode_atts['use_icon_font_size']; $icon_font_size = $this->shortcode_atts['icon_font_size']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( 'off' !== $use_icon_font_size ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et-pb-icon', 'declaration' => sprintf( 'font-size: %1$s;', esc_html( et_builder_process_range_value( $icon_font_size ) ) ), ) ); } if ( '' !== $max_width ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_main_blurb_image img', 'declaration' => sprintf( 'max-width: %1$s;', esc_html( et_builder_process_range_value( $max_width ) ) ), ) ); } if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } if ( is_rtl() && 'left' === $icon_placement ) { $icon_placement = 'right'; } if ( '' !== $title && '' !== $url ) { $title = sprintf( '%2$s', esc_url( $url ), esc_html( $title ), ( 'on' === $url_new_window ? ' target="_blank"' : '' ) ); } if ( '' !== $title ) { $title = "

{$title}

"; } if ( '' !== trim( $image ) || '' !== $font_icon ) { if ( 'off' === $use_icon ) { $image = sprintf( '%2$s', esc_attr( $image ), esc_attr( $alt ), esc_attr( " et_pb_animation_{$animation}" ) ); } else { $icon_style = sprintf( 'color: %1$s;', esc_attr( $icon_color ) ); if ( 'on' === $use_circle ) { $icon_style .= sprintf( ' background-color: %1$s;', esc_attr( $circle_color ) ); if ( 'on' === $use_circle_border ) { $icon_style .= sprintf( ' border-color: %1$s;', esc_attr( $circle_border_color ) ); } } $image = sprintf( '%1$s', esc_attr( et_pb_process_font_icon( $font_icon ) ), esc_attr( " et_pb_animation_{$animation}" ), ( 'on' === $use_circle ? ' et-pb-icon-circle' : '' ), ( 'on' === $use_circle && 'on' === $use_circle_border ? ' et-pb-icon-circle-border' : '' ), $icon_style ); } $image = sprintf( '
%1$s
', ( '' !== $url ? sprintf( '%2$s', esc_url( $url ), $image, ( 'on' === $url_new_window ? ' target="_blank"' : '' ) ) : $image ) ); } $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; $output = sprintf( '
%2$s
%3$s %1$s
', $this->shortcode_content, $image, $title, esc_attr( $class ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ), sprintf( ' et_pb_blurb_position_%1$s', esc_attr( $icon_placement ) ) ); return $output; } } new ET_Builder_Module_Blurb; class ET_Builder_Module_Tabs extends ET_Builder_Module { function init() { $this->name = __( 'Tabs', 'et_builder' ); $this->slug = 'et_pb_tabs'; $this->child_slug = 'et_pb_tab'; $this->child_item_text = __( 'Tab', 'et_builder' ); $this->whitelisted_fields = array( 'admin_label', 'module_id', 'module_class', 'active_tab_background_color', 'inactive_tab_background_color', ); $this->main_css_element = '%%order_class%%.et_pb_tabs'; $this->advanced_options = array( 'fonts' => array( 'tab' => array( 'label' => __( 'Tab', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_tabs_controls li", 'color' => "{$this->main_css_element} .et_pb_tabs_controls li a", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_all_tabs", 'line_height' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'css' => array( 'main' => "{$this->main_css_element} .et_pb_all_tabs", ), 'settings' => array( 'color' => 'alpha', ), ), 'border' => array(), ); $this->custom_css_options = array( 'tabs_controls' => array( 'label' => __( 'Tabs Controls', 'et_builder' ), 'selector' => '.et_pb_tabs_controls', ), 'tab' => array( 'label' => __( 'Tab', 'et_builder' ), 'selector' => '.et_pb_tabs_controls li', ), 'active_tab' => array( 'label' => __( 'Active Tab', 'et_builder' ), 'selector' => '.et_pb_tabs_controls li.et_pb_tab_active', ), ); } function get_fields() { $fields = array( 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'active_tab_background_color' => array( 'label' => __( 'Active Tab Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'inactive_tab_background_color' => array( 'label' => __( 'Inactive Tab Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $active_tab_background_color = $this->shortcode_atts['active_tab_background_color']; $inactive_tab_background_color = $this->shortcode_atts['inactive_tab_background_color']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); $all_tabs_content = $this->shortcode_content; global $et_pb_tab_titles; global $et_pb_tab_classes; if ( '' !== $inactive_tab_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_tabs_controls li', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $inactive_tab_background_color ) ), ) ); } if ( '' !== $active_tab_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_tabs_controls li.et_pb_tab_active', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $active_tab_background_color ) ), ) ); } $tabs = ''; $i = 0; if ( ! empty( $et_pb_tab_titles ) ) { foreach ( $et_pb_tab_titles as $tab_title ){ ++$i; $tabs .= sprintf( '
  • %2$s
  • ', ( 1 == $i ? ' et_pb_tab_active' : '' ), esc_html( $tab_title ), esc_attr( ltrim( $et_pb_tab_classes[ $i-1 ] ) ) ); } } $et_pb_tab_titles = $et_pb_tab_classes = array(); $output = sprintf( '
      %1$s
    %2$s
    ', $tabs, $all_tabs_content, ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ) ); return $output; } } new ET_Builder_Module_Tabs; class ET_Builder_Module_Tabs_Item extends ET_Builder_Module { function init() { $this->name = __( 'Tab', 'et_builder' ); $this->slug = 'et_pb_tab'; $this->type = 'child'; $this->child_title_var = 'title'; $this->whitelisted_fields = array( 'title', 'content_new', ); $this->advanced_setting_title_text = __( 'New Tab', 'et_builder' ); $this->settings_text = __( 'Tab Settings', 'et_builder' ); $this->main_css_element = '%%order_class%%'; $this->advanced_options = array( 'fonts' => array( 'tab' => array( 'label' => __( 'Tab', 'et_builder' ), 'css' => array( 'main' => ".et_pb_tabs .et_pb_tabs_controls li{$this->main_css_element}", 'color' => ".et_pb_tabs .et_pb_tabs_controls li{$this->main_css_element} a", 'important' => 'all', ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), ), 'background' => array( 'css' => array( 'main' => "div{$this->main_css_element}", 'important' => 'all', ), 'settings' => array( 'color' => 'alpha', ), ), ); } function get_fields() { $fields = array( 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'description' => __( 'The title will be used within the tab button for this tab.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'description' => __( 'Here you can define the content that will be placed within the current tab.', 'et_builder' ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { global $et_pb_tab_titles; global $et_pb_tab_classes; $title = $this->shortcode_atts['title']; $module_class = ET_Builder_Element::add_module_order_class( '', $function_name ); $i = 0; $et_pb_tab_titles[] = '' !== $title ? $title : __( 'Tab', 'et_builder' ); $et_pb_tab_classes[] = $module_class; $output = sprintf( '
    %1$s
    ', $this->shortcode_content, ( 1 === count( $et_pb_tab_titles ) ? ' et_pb_active_content' : '' ), esc_attr( $module_class ) ); return $output; } } new ET_Builder_Module_Tabs_Item; class ET_Builder_Module_Slider extends ET_Builder_Module { function init() { $this->name = __( 'Slider', 'et_builder' ); $this->slug = 'et_pb_slider'; $this->child_slug = 'et_pb_slide'; $this->child_item_text = __( 'Slide', 'et_builder' ); $this->whitelisted_fields = array( 'show_arrows', 'show_pagination', 'auto', 'auto_speed', 'auto_ignore_hover', 'parallax', 'parallax_method', 'remove_inner_shadow', 'background_position', 'background_size', 'admin_label', 'module_id', 'module_class', 'top_padding', 'bottom_padding', 'hide_content_on_mobile', 'hide_cta_on_mobile', 'show_image_video_mobile', ); $this->fields_defaults = array( 'show_arrows' => array( 'on' ), 'show_pagination' => array( 'on' ), 'auto' => array( 'off' ), 'auto_speed' => array( '7000' ), 'auto_ignore_hover' => array( 'off' ), 'parallax' => array( 'off' ), 'parallax_method' => array( 'off' ), 'remove_inner_shadow' => array( 'off' ), 'background_position' => array( 'default' ), 'background_size' => array( 'default' ), 'hide_content_on_mobile' => array( 'off' ), 'hide_cta_on_mobile' => array( 'off' ), 'show_image_video_mobile' => array( 'off' ), ); $this->main_css_element = '%%order_class%%.et_pb_slider'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_slide_description h2", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element}", 'main' => "{$this->main_css_element} .et_pb_slide_content", ), ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), ), ), ); $this->custom_css_options = array( 'slide_description' => array( 'label' => __( 'Slide Description', 'et_builder' ), 'selector' => '.et_pb_slide_description', ), 'slide_title' => array( 'label' => __( 'Slide Title', 'et_builder' ), 'selector' => '.et_pb_slide_description h2', ), 'slide_button' => array( 'label' => __( 'Slide Button', 'et_builder' ), 'selector' => 'a.et_pb_more_button', ), 'slide_controllers' => array( 'label' => __( 'Slide Controllers', 'et_builder' ), 'selector' => '.et-pb-controllers', ), 'slide_active_controller' => array( 'label' => __( 'Slide Active Controller', 'et_builder' ), 'selector' => '.et-pb-controllers .et-pb-active-control', ), ); } function get_fields() { $fields = array( 'show_arrows' => array( 'label' => __( 'Arrows', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Show Arrows', 'et_builder' ), 'off' => __( 'Hide Arrows', 'et_builder' ), ), 'description' => __( 'This setting will turn on and off the navigation arrows.', 'et_builder' ), ), 'show_pagination' => array( 'label' => __( 'Controls', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Show Slider Controls', 'et_builder' ), 'off' => __( 'Hide Slider Controls', 'et_builder' ), ), 'description' => __( 'This setting will turn on and off the circle buttons at the bottom of the slider.', 'et_builder' ), ), 'auto' => array( 'label' => __( 'Automatic Animation', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'Off', 'et_builder' ), 'on' => __( 'On', 'et_builder' ), ), 'affects' => array( '#et_pb_auto_speed, #et_pb_auto_ignore_hover', ), 'description' => __( 'If you would like the slider to slide automatically, without the visitor having to click the next button, enable this option and then adjust the rotation speed below if desired.', 'et_builder' ), ), 'auto_speed' => array( 'label' => __( 'Automatic Animation Speed (in ms)', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'depends_default' => true, 'description' => __( "Here you can designate how fast the slider fades between each slide, if 'Automatic Animation' option is enabled above. The higher the number the longer the pause between each rotation.", 'et_builder' ), ), 'auto_ignore_hover' => array( 'label' => __( 'Continue Automatic Slide on Hover', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'depends_default' => true, 'options' => array( 'off' => __( 'Off', 'et_builder' ), 'on' => __( 'On', 'et_builder' ), ), 'description' => __( 'Turning this on will allow automatic sliding to continue on mouse hover.', 'et_builder' ), ), 'parallax' => array( 'label' => __( 'Use Parallax effect', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_parallax_method', '#et_pb_background_position', '#et_pb_background_size', ), 'description' => __( 'Enabling this option will give your background images a fixed position as you scroll.', 'et_builder' ), ), 'parallax_method' => array( 'label' => __( 'Parallax method', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'CSS', 'et_builder' ), 'on' => __( 'True Parallax', 'et_builder' ), ), 'depends_show_if' => 'on', 'description' => __( 'Define the method, used for the parallax effect.', 'et_builder' ), ), 'remove_inner_shadow' => array( 'label' => __( 'Remove Inner Shadow', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), ), 'background_position' => array( 'label' => __( 'Background Image Position', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'default' => __( 'Default', 'et_builder' ), 'top_left' => __( 'Top Left', 'et_builder' ), 'top_center' => __( 'Top Center', 'et_builder' ), 'top_right' => __( 'Top Right', 'et_builder' ), 'center_right' => __( 'Center Right', 'et_builder' ), 'center_left' => __( 'Center Left', 'et_builder' ), 'bottom_left' => __( 'Bottom Left', 'et_builder' ), 'bottom_center' => __( 'Bottom Center', 'et_builder' ), 'bottom_right' => __( 'Bottom Right', 'et_builder' ), ), 'depends_show_if' => 'off', ), 'background_size' => array( 'label' => __( 'Background Image Size', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'default' => __( 'Default', 'et_builder' ), 'contain' => __( 'Fit', 'et_builder' ), 'initial' => __( 'Actual Size', 'et_builder' ), ), 'depends_show_if' => 'off', ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'top_padding' => array( 'label' => __( 'Top Padding', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), 'bottom_padding' => array( 'label' => __( 'Bottom Padding', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), 'hide_content_on_mobile' => array( 'label' => __( 'Hide Content On Mobile', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', ), 'hide_cta_on_mobile' => array( 'label' => __( 'Hide CTA On Mobile', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', ), 'show_image_video_mobile' => array( 'label' => __( 'Show Image / Video On Mobile', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', ), ); return $fields; } function pre_shortcode_content() { global $et_pb_slider_has_video, $et_pb_slider_parallax, $et_pb_slider_parallax_method, $et_pb_slider_hide_mobile, $et_pb_slider_custom_icon, $et_pb_slider_item_num; $et_pb_slider_item_num = 0; $parallax = $this->shortcode_atts['parallax']; $parallax_method = $this->shortcode_atts['parallax_method']; $hide_content_on_mobile = $this->shortcode_atts['hide_content_on_mobile']; $hide_cta_on_mobile = $this->shortcode_atts['hide_cta_on_mobile']; $button_custom = $this->shortcode_atts['custom_button']; $custom_icon = $this->shortcode_atts['button_icon']; $et_pb_slider_has_video = false; $et_pb_slider_parallax = $parallax; $et_pb_slider_parallax_method = $parallax_method; $et_pb_slider_hide_mobile = array( 'hide_content_on_mobile' => $hide_content_on_mobile, 'hide_cta_on_mobile' => $hide_cta_on_mobile, ); $et_pb_slider_custom_icon = 'on' === $button_custom ? $custom_icon : ''; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $show_arrows = $this->shortcode_atts['show_arrows']; $show_pagination = $this->shortcode_atts['show_pagination']; $parallax = $this->shortcode_atts['parallax']; $parallax_method = $this->shortcode_atts['parallax_method']; $auto = $this->shortcode_atts['auto']; $auto_speed = $this->shortcode_atts['auto_speed']; $auto_ignore_hover = $this->shortcode_atts['auto_ignore_hover']; $top_padding = $this->shortcode_atts['top_padding']; $body_font_size = $this->shortcode_atts['body_font_size']; $bottom_padding = $this->shortcode_atts['bottom_padding']; $remove_inner_shadow = $this->shortcode_atts['remove_inner_shadow']; $hide_content_on_mobile = $this->shortcode_atts['hide_content_on_mobile']; $hide_cta_on_mobile = $this->shortcode_atts['hide_cta_on_mobile']; $show_image_video_mobile = $this->shortcode_atts['show_image_video_mobile']; $background_position = $this->shortcode_atts['background_position']; $background_size = $this->shortcode_atts['background_size']; global $et_pb_slider_has_video, $et_pb_slider_parallax, $et_pb_slider_parallax_method, $et_pb_slider_hide_mobile, $et_pb_slider_custom_icon; $content = $this->shortcode_content; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $top_padding ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_slide_description, .et_pb_slider_fullwidth_off%%order_class%% .et_pb_slide_description', 'declaration' => sprintf( 'padding-top: %1$s;', esc_html( et_builder_process_range_value( $top_padding ) ) ), ) ); } if ( '' !== $bottom_padding ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_slide_description, .et_pb_slider_fullwidth_off%%order_class%% .et_pb_slide_description', 'declaration' => sprintf( 'padding-bottom: %1$s;', esc_html( et_builder_process_range_value( $bottom_padding ) ) ), ) ); } if ( '' !== $bottom_padding || '' !== $top_padding ) { ET_Builder_Module::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_slide_description, .et_pb_slider_fullwidth_off%%order_class%% .et_pb_slide_description', 'declaration' => 'padding-right: 0; padding-left: 0;', ) ); } if ( 'default' !== $background_position && 'off' === $parallax ) { $processed_position = str_replace( '_', ' ', $background_position ); ET_Builder_Module::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf( 'background-position: %1$s;', esc_html( $processed_position ) ), ) ); } if ( 'default' !== $background_size && 'off' === $parallax ) { ET_Builder_Module::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf( '-moz-background-size: %1$s; -webkit-background-size: %1$s; background-size: %1$s;', esc_html( $background_size ) ), ) ); } $fullwidth = 'et_pb_fullwidth_slider' === $function_name ? 'on' : 'off'; $class = ''; $class .= 'off' === $fullwidth ? ' et_pb_slider_fullwidth_off' : ''; $class .= 'off' === $show_arrows ? ' et_pb_slider_no_arrows' : ''; $class .= 'off' === $show_pagination ? ' et_pb_slider_no_pagination' : ''; $class .= 'on' === $parallax ? ' et_pb_slider_parallax' : ''; $class .= 'on' === $auto ? ' et_slider_auto et_slider_speed_' . esc_attr( $auto_speed ) : ''; $class .= 'on' === $auto_ignore_hover ? ' et_slider_auto_ignore_hover' : ''; $class .= 'on' === $remove_inner_shadow ? ' et_pb_slider_no_shadow' : ''; $class .= 'on' === $show_image_video_mobile ? ' et_pb_slider_show_image' : ''; $output = sprintf( '
    %2$s
    ', $class, $content, ( $et_pb_slider_has_video ? ' et_pb_preload' : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ) ); return $output; } } new ET_Builder_Module_Slider; class ET_Builder_Module_Slider_Item extends ET_Builder_Module { function init() { $this->name = __( 'Slide', 'et_builder' ); $this->slug = 'et_pb_slide'; $this->type = 'child'; $this->child_title_var = 'admin_title'; $this->child_title_fallback_var = 'heading'; $this->whitelisted_fields = array( 'heading', 'admin_title', 'button_text', 'button_link', 'background_image', 'background_position', 'background_size', 'background_color', 'image', 'alignment', 'video_url', 'image_alt', 'background_layout', 'video_bg_mp4', 'video_bg_webm', 'video_bg_width', 'video_bg_height', 'allow_player_pause', 'content_new', 'arrows_custom_color', 'dot_nav_custom_color', ); $this->fields_defaults = array( 'button_link' => array( '#' ), 'background_position' => array( 'default' ), 'background_size' => array( 'default' ), 'background_color' => array( '#ffffff', 'only_default_setting' ), 'alignment' => array( 'center' ), 'background_layout' => array( 'dark' ), 'allow_player_pause' => array( 'off' ), ); $this->advanced_setting_title_text = __( 'New Slide', 'et_builder' ); $this->settings_text = __( 'Slide Settings', 'et_builder' ); $this->main_css_element = '%%order_class%%'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => ".et_pb_slider {$this->main_css_element} .et_pb_slide_description h2", 'important' => 'all', ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_slide_content", 'line_height' => "{$this->main_css_element} p", 'important' => 'all', ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), 'css' => array( 'main' => ".et_pb_slider {$this->main_css_element}.et_pb_slide .et_pb_button", ), ), ), ); } function get_fields() { $fields = array( 'heading' => array( 'label' => __( 'Heading', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define the title text for your slide.', 'et_builder' ), ), 'button_text' => array( 'label' => __( 'Button Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define the text for the slide button', 'et_builder' ), ), 'button_link' => array( 'label' => __( 'Button URL', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input a destination URL for the slide button.', 'et_builder' ), ), 'background_image' => array( 'label' => __( 'Background Image', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose a Background Image', 'et_builder' ), 'update_text' => __( 'Set As Background', 'et_builder' ), 'description' => __( 'If defined, this image will be used as the background for this module. To remove a background image, simply delete the URL from the settings field.', 'et_builder' ), ), 'background_position' => array( 'label' => __( 'Background Image Position', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'default' => __( 'Default', 'et_builder' ), 'center' => __( 'Center', 'et_builder' ), 'top_left' => __( 'Top Left', 'et_builder' ), 'top_center' => __( 'Top Center', 'et_builder' ), 'top_right' => __( 'Top Right', 'et_builder' ), 'center_right' => __( 'Center Right', 'et_builder' ), 'center_left' => __( 'Center Left', 'et_builder' ), 'bottom_left' => __( 'Bottom Left', 'et_builder' ), 'bottom_center' => __( 'Bottom Center', 'et_builder' ), 'bottom_right' => __( 'Bottom Right', 'et_builder' ), ), ), 'background_size' => array( 'label' => __( 'Background Image Size', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'default' => __( 'Default', 'et_builder' ), 'cover' => __( 'Cover', 'et_builder' ), 'contain' => __( 'Fit', 'et_builder' ), 'initial' => __( 'Actual Size', 'et_builder' ), ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Use the color picker to choose a background color for this module.', 'et_builder' ), ), 'image' => array( 'label' => __( 'Slide Image', 'et_builder' ), 'type' => 'upload', 'option_category' => 'configuration', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose a Slide Image', 'et_builder' ), 'update_text' => __( 'Set As Slide Image', 'et_builder' ), 'description' => __( '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' ), ), 'alignment' => array( 'label' => __( 'Slide Image Vertical Alignment', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => array( 'center' => __( 'Center', 'et_builder' ), 'bottom' => __( 'Bottom', 'et_builder' ), ), 'description' => __( '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' => __( 'Slide Video', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( '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' ), ), 'image_alt' => array( 'label' => __( 'Image Alternative Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'If you have a slide image defined, input your HTML ALT text for the image here.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text is light or dark. If you have a slide with a dark background, then choose light text. If you have a light background, then use dark text.' , 'et_builder' ), ), 'video_bg_mp4' => array( 'label' => __( 'Background Video MP4', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Background Video MP4 File', 'et_builder' ), 'update_text' => __( 'Set As Background Video', 'et_builder' ), 'description' => __( 'All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .MP4 version here. Important Note: Video backgrounds are disabled from mobile devices. Instead, your background image will be used. For this reason, you should define both a background image and a background video to ensure best results.', 'et_builder' ), ), 'video_bg_webm' => array( 'label' => __( 'Background Video Webm', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => __( 'Upload a video', 'et_builder' ), 'choose_text' => __( 'Choose a Background Video WEBM File', 'et_builder' ), 'update_text' => __( 'Set As Background Video', 'et_builder' ), 'description' => __( 'All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .WEBM version here. Important Note: Video backgrounds are disabled from mobile devices. Instead, your background image will be used. For this reason, you should define both a background image and a background video to ensure best results.', 'et_builder' ), ), 'video_bg_width' => array( 'label' => __( 'Background Video Width', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'In order for videos to be sized correctly, you must input the exact width (in pixels) of your video here.' ,'et_builder' ), ), 'video_bg_height' => array( 'label' => __( 'Background Video Height', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'In order for videos to be sized correctly, you must input the exact height (in pixels) of your video here.' ,'et_builder' ), ), 'allow_player_pause' => array( 'label' => __( 'Pause Video', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'description' => __( 'Allow video to be paused by other players when they begin playing' ,'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input your main slide text content here.', 'et_builder' ), ), 'arrows_custom_color' => array( 'label' => __( 'Arrows Custom Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'dot_nav_custom_color' => array( 'label' => __( 'Dot Nav Custom Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'admin_title' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the slide in the builder for easy identification.', 'et_builder' ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $alignment = $this->shortcode_atts['alignment']; $heading = $this->shortcode_atts['heading']; $button_text = $this->shortcode_atts['button_text']; $button_link = $this->shortcode_atts['button_link']; $background_color = $this->shortcode_atts['background_color']; $background_image = $this->shortcode_atts['background_image']; $image = $this->shortcode_atts['image']; $image_alt = $this->shortcode_atts['image_alt']; $background_layout = $this->shortcode_atts['background_layout']; $video_bg_webm = $this->shortcode_atts['video_bg_webm']; $video_bg_mp4 = $this->shortcode_atts['video_bg_mp4']; $video_bg_width = $this->shortcode_atts['video_bg_width']; $video_bg_height = $this->shortcode_atts['video_bg_height']; $video_url = $this->shortcode_atts['video_url']; $allow_player_pause = $this->shortcode_atts['allow_player_pause']; $dot_nav_custom_color = $this->shortcode_atts['dot_nav_custom_color']; $arrows_custom_color = $this->shortcode_atts['arrows_custom_color']; $custom_icon = $this->shortcode_atts['button_icon']; $button_custom = $this->shortcode_atts['custom_button']; $background_position = $this->shortcode_atts['background_position']; $background_size = $this->shortcode_atts['background_size']; global $et_pb_slider_has_video, $et_pb_slider_parallax, $et_pb_slider_parallax_method, $et_pb_slider_hide_mobile, $et_pb_slider_custom_icon, $et_pb_slider_item_num; $background_video = ''; $et_pb_slider_item_num++; $hide_on_mobile_class = self::HIDE_ON_MOBILE; $first_video = false; $custom_slide_icon = 'on' === $button_custom && '' !== $custom_icon ? $custom_icon : $et_pb_slider_custom_icon; if ( '' !== $video_bg_mp4 || '' !== $video_bg_webm ) { if ( ! $et_pb_slider_has_video ) $first_video = true; $background_video = sprintf( '
    %1$s
    ', do_shortcode( sprintf( ' ', ( '' !== $video_bg_mp4 ? sprintf( '', esc_attr( $video_bg_mp4 ) ) : '' ), ( '' !== $video_bg_webm ? sprintf( '', esc_attr( $video_bg_webm ) ) : '' ), ( '' !== $video_bg_width ? sprintf( ' width="%s"', esc_attr( $video_bg_width ) ) : '' ), ( '' !== $video_bg_height ? sprintf( ' height="%s"', esc_attr( $video_bg_height ) ) : '' ), ( '' !== $background_image ? sprintf( ' poster="%s"', esc_attr( $background_image ) ) : '' ) ) ), ( $first_video ? ' et_pb_first_video' : '' ), ( 'on' === $allow_player_pause ? ' et_pb_allow_player_pause' : '' ) ); $et_pb_slider_has_video = true; wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'wp-mediaelement' ); } if ( '' !== $heading ) { if ( '#' !== $button_link ) { $heading = sprintf( '%2$s', esc_url( $button_link ), $heading ); } $heading = '

    ' . $heading . '

    '; } $button = ''; if ( '' !== $button_text ) { $button = sprintf( '%2$s', esc_attr( $button_link ), esc_html( $button_text ), ( 'on' === $et_pb_slider_hide_mobile['hide_cta_on_mobile'] ? esc_attr( " {$hide_on_mobile_class}" ) : '' ), '' !== $custom_slide_icon ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_slide_icon ) ) ) : '', '' !== $custom_slide_icon ? ' et_pb_custom_button_icon' : '' ); } $style = $class = ''; if ( '' !== $background_color ) { $style .= sprintf( 'background-color:%s;', esc_attr( $background_color ) ); } if ( '' !== $background_image && 'on' !== $et_pb_slider_parallax ) { $style .= sprintf( 'background-image:url(%s);', esc_attr( $background_image ) ); } $style = '' !== $style ? " style='{$style}'" : ''; $image = '' !== $image ? sprintf( '
    %2$s
    ', esc_attr( $image ), esc_attr( $image_alt ) ) : ''; if ( '' !== $video_url ) { global $wp_embed; $video_embed = apply_filters( 'the_content', $wp_embed->shortcode( '', esc_url( $video_url ) ) ); $video_embed = preg_replace('//','',$video_embed); $image = sprintf( '
    %1$s
    ', $video_embed ); } if ( '' !== $image ) $class = ' et_pb_slide_with_image'; if ( '' !== $video_url ) $class .= ' et_pb_slide_with_video'; $class .= " et_pb_bg_layout_{$background_layout}"; if ( 'bottom' !== $alignment ) { $class .= " et_pb_media_alignment_{$alignment}"; } $data_dot_nav_custom_color = '' !== $dot_nav_custom_color ? sprintf( ' data-dots_color="%1$s"', esc_attr( $dot_nav_custom_color ) ) : ''; $data_arrows_custom_color = '' !== $arrows_custom_color ? sprintf( ' data-arrows_color="%1$s"', esc_attr( $arrows_custom_color ) ) : ''; if ( 'default' !== $background_position && 'off' === $et_pb_slider_parallax ) { $processed_position = str_replace( '_', ' ', $background_position ); ET_Builder_Module::set_style( $function_name, array( 'selector' => '.et_pb_slider %%order_class%%', 'declaration' => sprintf( 'background-position: %1$s;', esc_html( $processed_position ) ), ) ); } if ( 'default' !== $background_size && 'off' === $et_pb_slider_parallax ) { ET_Builder_Module::set_style( $function_name, array( 'selector' => '.et_pb_slider %%order_class%%', 'declaration' => sprintf( '-moz-background-size: %1$s; -webkit-background-size: %1$s; background-size: %1$s;', esc_html( $background_size ) ), ) ); } $class = ET_Builder_Element::add_module_order_class( $class, $function_name ); if ( 1 === $et_pb_slider_item_num ) { $class .= " et-pb-active-slide"; } $output = sprintf( '
    %8$s
    %5$s
    %1$s
    %2$s
    %3$s
    %7$s
    ', $heading, $this->shortcode_content, $button, $style, $image, esc_attr( $class ), ( '' !== $background_video ? $background_video : '' ), ( '' !== $background_image && 'on' === $et_pb_slider_parallax ? sprintf( '
    ', esc_attr( $background_image ), ( 'off' === $et_pb_slider_parallax_method ? ' et_pb_parallax_css' : '' ) ) : '' ), ( 'on' === $et_pb_slider_hide_mobile['hide_content_on_mobile'] ? esc_attr( " {$hide_on_mobile_class}" ) : '' ), $data_dot_nav_custom_color, $data_arrows_custom_color ); return $output; } } new ET_Builder_Module_Slider_Item; class ET_Builder_Module_Testimonial extends ET_Builder_Module { function init() { $this->name = __( 'Testimonial', 'et_builder' ); $this->slug = 'et_pb_testimonial'; $this->whitelisted_fields = array( 'author', 'job_title', 'company_name', 'url', 'url_new_window', 'portrait_url', 'quote_icon', 'use_background_color', 'background_color', 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'quote_icon_color', 'portrait_border_radius', 'portrait_width', 'portrait_height', ); $this->fields_defaults = array( 'url_new_window' => array( 'off' ), 'quote_icon' => array( 'on' ), 'use_background_color' => array( 'on' ), 'background_color' => array( '#f5f5f5', 'add_default_setting' ), 'background_layout' => array( 'dark' ), 'text_orientation' => array( 'left' ), ); $this->main_css_element = '%%order_class%%.et_pb_testimonial'; $this->advanced_options = array( 'fonts' => array( 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'use_background_color' => false, 'settings' => array( 'color' => 'alpha', ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), ); $this->custom_css_options = array( 'testimonial_portrait' => array( 'label' => __( 'Testimonial Portrait', 'et_builder' ), 'selector' => '.et_pb_testimonial_portrait', ), 'testimonial_description' => array( 'label' => __( 'Testimonial Description', 'et_builder' ), 'selector' => '.et_pb_testimonial_description', ), 'testimonial_author' => array( 'label' => __( 'Testimonial Author', 'et_builder' ), 'selector' => 'et_pb_testimonial_author', ), 'testimonial_meta' => array( 'label' => __( 'Testimonial Meta', 'et_builder' ), 'selector' => '.et_pb_testimonial p:last-of-type', ), ); } function get_fields() { $fields = array( 'author' => array( 'label' => __( 'Author Name', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the name of the testimonial author.', 'et_builder' ), ), 'job_title' => array( 'label' => __( 'Job Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the job title.', 'et_builder' ), ), 'company_name' => array( 'label' => __( 'Company Name', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the name of the company.', 'et_builder' ), ), 'url' => array( 'label' => __( 'Author/Company URL', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the website of the author or leave blank for no link.', 'et_builder' ), ), 'url_new_window' => array( 'label' => __( 'URLs Open', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'In The Same Window', 'et_builder' ), 'on' => __( 'In The New Tab', 'et_builder' ), ), 'description' => __( 'Choose whether or not the URL should open in a new window.', 'et_builder' ), ), 'portrait_url' => array( 'label' => __( 'Portrait Image URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'description' => __( 'Upload your desired image, or type in the URL to the image you would like to display.', 'et_builder' ), ), 'quote_icon' => array( 'label' => __( 'Quote Icon', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Visible', 'et_builder' ), 'off' => __( 'Hidden', 'et_builder' ), ), 'description' => __( 'Choose whether or not the quote icon should be visible.', 'et_builder' ), ), 'use_background_color' => array( 'label' => __( 'Use Background Color', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'affects' => array( '#et_pb_background_color', ), 'description' => __( 'Here you can choose whether background color setting below should be used or not.', 'et_builder' ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Here you can define a custom background color for your CTA.', 'et_builder' ), 'depends_default' => true, ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'light' => __( 'Dark', 'et_builder' ), 'dark' => __( 'Light', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'This will adjust the alignment of the module text.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input the main text content for your module here.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'quote_icon_color' => array( 'label' => __( 'Quote Icon Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'portrait_border_radius' => array( 'label' => __( 'Portrait Border Radius', 'et_builder' ), 'type' => 'range', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), 'portrait_width' => array( 'label' => __( 'Portrait Width', 'et_builder' ), 'type' => 'range', 'option_category' => 'layout', 'tab_slug' => 'advanced', 'range_settings' => array( 'min' => '1', 'max' => '200', 'step' => '1', ), ), 'portrait_height' => array( 'label' => __( 'Portrait Height', 'et_builder' ), 'type' => 'range', 'option_category' => 'layout', 'tab_slug' => 'advanced', 'range_settings' => array( 'min' => '1', 'max' => '200', 'step' => '1', ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $author = $this->shortcode_atts['author']; $job_title = $this->shortcode_atts['job_title']; $portrait_url = $this->shortcode_atts['portrait_url']; $company_name = $this->shortcode_atts['company_name']; $url = $this->shortcode_atts['url']; $quote_icon = $this->shortcode_atts['quote_icon']; $url_new_window = $this->shortcode_atts['url_new_window']; $use_background_color = $this->shortcode_atts['use_background_color']; $background_color = $this->shortcode_atts['background_color']; $background_layout = $this->shortcode_atts['background_layout']; $text_orientation = $this->shortcode_atts['text_orientation']; $quote_icon_color = $this->shortcode_atts['quote_icon_color']; $portrait_border_radius = $this->shortcode_atts['portrait_border_radius']; $portrait_width = $this->shortcode_atts['portrait_width']; $portrait_height = $this->shortcode_atts['portrait_height']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $portrait_border_radius ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_testimonial_portrait, %%order_class%% .et_pb_testimonial_portrait:before', 'declaration' => sprintf( '-webkit-border-radius: %1$s; -moz-border-radius: %1$s; border-radius: %1$s;', esc_html( et_builder_process_range_value( $portrait_border_radius ) ) ), ) ); } if ( '' !== $portrait_width ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_testimonial_portrait', 'declaration' => sprintf( 'width: %1$s;', esc_html( et_builder_process_range_value( $portrait_width ) ) ), ) ); } if ( '' !== $portrait_height ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_testimonial_portrait', 'declaration' => sprintf( 'height: %1$s;', esc_html( et_builder_process_range_value( $portrait_height ) ) ), ) ); } $style = ''; if ( 'on' === $use_background_color && $this->fields_defaults['background_color'][0] !== $background_color ) { $style .= sprintf( 'background-color: %1$s !important; ', esc_html( $background_color ) ); } if ( '' !== $style ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_testimonial', 'declaration' => rtrim( $style ), ) ); } if ( '' !== $quote_icon_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_testimonial:before', 'declaration' => sprintf( 'color: %1$s;', esc_html( $quote_icon_color ) ), ) ); } if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } $portrait_image = ''; $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; if ( ! isset( $atts['quote_icon'] ) ) { $class .= " et_pb_testimonial_old_layout"; } if ( '' !== $portrait_url ) { $portrait_image = sprintf( '
    ', esc_attr( $portrait_url ) ); } if ( '' !== $url && ( '' !== $company_name || '' !== $author ) ) { $link_output = sprintf( '%2$s', esc_url( $url ), ( '' !== $company_name ? esc_html( $company_name ) : esc_html( $author ) ), ( 'on' === $url_new_window ? ' target="_blank"' : '' ) ); if ( '' !== $company_name ) { $company_name = $link_output; } else { $author = $link_output; } } $output = sprintf( ' %8$s
    %1$s %2$s

    %6$s%7$s

    ', $this->shortcode_content, $author, ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ), ( 'off' === $quote_icon ? ' et_pb_icon_off' : '' ), ( '' !== $job_title ? esc_html( $job_title ) : '' ), ( '' !== $company_name ? sprintf( '%2$s%1$s', $company_name, ( '' !== $job_title ? ', ' : '' ) ) : '' ), ( '' !== $portrait_image ? $portrait_image : '' ), ( '' === $portrait_image ? ' et_pb_testimonial_no_image' : '' ), esc_attr( $class ), ( 'on' === $use_background_color ? sprintf( ' style="background-color: %1$s;"', esc_attr( $background_color ) ) : '' ), ( 'off' === $use_background_color ? ' et_pb_testimonial_no_bg' : '' ) ); return $output; } } new ET_Builder_Module_Testimonial; class ET_Builder_Module_Pricing_Tables extends ET_Builder_Module { function init() { $this->name = __( 'Pricing Tables', 'et_builder' ); $this->slug = 'et_pb_pricing_tables'; $this->main_css_element = '%%order_class%%.et_pb_pricing'; $this->child_slug = 'et_pb_pricing_table'; $this->child_item_text = __( 'Pricing Table', 'et_builder' ); $this->whitelisted_fields = array( 'admin_label', 'module_id', 'module_class', 'featured_table_background_color', 'header_background_color', 'featured_table_header_background_color', 'featured_table_header_text_color', 'featured_table_subheader_text_color', 'featured_table_price_color', 'featured_table_text_color', 'show_bullet', 'bullet_color', 'featured_table_bullet_color', 'remove_featured_drop_shadow', 'center_list_items', ); $this->fields_defaults = array( 'show_bullet' => array( 'on' ), 'remove_featured_drop_shadow' => array( 'off' ), 'center_list_items' => array( 'off' ), ); $this->additional_shortcode = 'et_pb_pricing_item'; $this->main_css_element = '%%order_class%%'; $this->custom_css_options = array( 'pricing_heading' => array( 'label' => __( 'Pricing Heading', 'et_builder' ), 'selector' => '.et_pb_pricing_heading', ), 'pricing_title' => array( 'label' => __( 'Pricing Title', 'et_builder' ), 'selector' => '.et_pb_pricing_heading h2', ), 'pricing_top' => array( 'label' => __( 'Pricing Top', 'et_builder' ), 'selector' => '.et_pb_pricing_content_top', ), 'price' => array( 'label' => __( 'Price', 'et_builder' ), 'selector' => '.et_pb_et_price', ), 'pricing_content' => array( 'label' => __( 'Pricing Content', 'et_builder' ), 'selector' => '.et_pb_pricing_content', ), 'pricing_button' => array( 'label' => __( 'Pricing Button', 'et_builder' ), 'selector' => '.et_pb_pricing_table_button', ), 'featured_table' => array( 'label' => __( 'Featured Table', 'et_builder' ), 'selector' => '.et_pb_featured_table', ), ); $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing_heading h2", ), ), 'subheader' => array( 'label' => __( 'Subheader', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_best_value", ), ), 'currency_frequency' => array( 'label' => __( 'Currency & Frequency', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_dollar_sign, {$this->main_css_element} .et_pb_frequency", ), ), 'price' => array( 'label' => __( 'Price', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_sum", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing li", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), ), 'background' => array( 'use_background_image' => false, 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing_table", ), 'settings' => array( 'color' => 'alpha', ), ), 'border' => array( 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing_table", ), 'additional_elements' => array( "{$this->main_css_element} .et_pb_pricing_content_top" => array( 'bottom' ), ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), ), ), ); } function get_fields() { $fields = array( 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'featured_table_background_color' => array( 'label' => __( 'Featured Table Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 23, ), 'header_background_color' => array( 'label' => __( 'Table Header Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'featured_table_header_background_color' => array( 'label' => __( 'Featured Table Header Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 21, ), 'featured_table_header_text_color' => array( 'label' => __( 'Featured Table Header Text Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 20, ), 'featured_table_subheader_text_color' => array( 'label' => __( 'Featured Table Subheader Text Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 20, ), 'featured_table_price_color' => array( 'label' => __( 'Featured Table Price Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 20, ), 'featured_table_text_color' => array( 'label' => __( 'Featured Table Body Text Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 22, ), 'show_bullet' => array( 'label' => __( 'Show Bullet', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'tab_slug' => 'advanced', 'affects' => array( '#et_pb_bullet_color', ), ), 'bullet_color' => array( 'label' => __( 'Bullet Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'depends_show_if' => 'on', ), 'featured_table_bullet_color' => array( 'label' => __( 'Featured Table Bullet Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', 'priority' => 22, ), 'remove_featured_drop_shadow' => array( 'label' => __( 'Remove Featured Table Drop Shadow', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', 'priority' => 24, ), 'center_list_items' => array( 'label' => __( 'Center List Items', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'tab_slug' => 'advanced', ), ); return $fields; } function pre_shortcode_content() { global $et_pb_pricing_tables_num, $et_pb_pricing_tables_icon; $button_custom = $this->shortcode_atts['custom_button']; $custom_icon = $this->shortcode_atts['button_icon']; $et_pb_pricing_tables_num = 0; $et_pb_pricing_tables_icon = 'on' === $button_custom ? $custom_icon : ''; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $featured_table_background_color = $this->shortcode_atts['featured_table_background_color']; $featured_table_text_color = $this->shortcode_atts['featured_table_text_color']; $header_background_color = $this->shortcode_atts['header_background_color']; $featured_table_header_background_color = $this->shortcode_atts['featured_table_header_background_color']; $featured_table_header_text_color = $this->shortcode_atts['featured_table_header_text_color']; $featured_table_subheader_text_color = $this->shortcode_atts['featured_table_subheader_text_color']; $featured_table_price_color = $this->shortcode_atts['featured_table_price_color']; $bullet_color = $this->shortcode_atts['bullet_color']; $featured_table_bullet_color = $this->shortcode_atts['featured_table_bullet_color']; $remove_featured_drop_shadow = $this->shortcode_atts['remove_featured_drop_shadow']; $center_list_items = $this->shortcode_atts['center_list_items']; $show_bullet = $this->shortcode_atts['show_bullet']; global $et_pb_pricing_tables_num, $et_pb_pricing_tables_icon; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( 'on' === $remove_featured_drop_shadow ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table', 'declaration' => '-moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none;', ) ); } if ( 'off' === $show_bullet ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_pricing li:before', 'declaration' => 'display: none;', ) ); } if ( 'on' === $center_list_items ) { $module_class .= ' et_pb_centered_pricing_items'; } if ( '' !== $featured_table_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $featured_table_background_color ) ), ) ); } if ( '' !== $header_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_pricing_heading', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $header_background_color ) ), ) ); } if ( '' !== $featured_table_header_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_pricing_heading', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $featured_table_header_background_color ) ), ) ); } if ( '' !== $featured_table_header_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_pricing_heading h2', 'declaration' => sprintf( 'color: %1$s;', esc_html( $featured_table_header_text_color ) ), ) ); } if ( '' !== $featured_table_subheader_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_best_value', 'declaration' => sprintf( 'color: %1$s;', esc_html( $featured_table_subheader_text_color ) ), ) ); } if ( '' !== $featured_table_price_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_sum', 'declaration' => sprintf( 'color: %1$s;', esc_html( $featured_table_price_color ) ), ) ); } if ( '' !== $featured_table_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_pricing_content', 'declaration' => sprintf( 'color: %1$s;', esc_html( $featured_table_text_color ) ), ) ); } if ( '' !== $bullet_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_pricing li:before', 'declaration' => sprintf( 'border-color: %1$s;', esc_html( $bullet_color ) ), ) ); } if ( '' !== $featured_table_bullet_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_featured_table .et_pb_pricing li:before', 'declaration' => sprintf( 'border-color: %1$s;', esc_html( $featured_table_bullet_color ) ), ) ); } $content = $this->shortcode_content; $output = sprintf( ' %1$s ', $content, esc_attr( " et_pb_pricing_{$et_pb_pricing_tables_num}" ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( ltrim( $module_class ) ) ) : '' ) ); return $output; } function additional_shortcode_callback( $atts, $content = null, $function_name ) { $attributes = shortcode_atts( array( 'available' => 'on', ), $atts ); $output = sprintf( '%1$s', $content, ( 'on' !== $attributes['available'] ? ' class="et_pb_not_available"' : '' ) ); return $output; } } new ET_Builder_Module_Pricing_Tables; class ET_Builder_Module_Pricing_Tables_Item extends ET_Builder_Module { function init() { $this->name = __( 'Pricing Table', 'et_builder' ); $this->slug = 'et_pb_pricing_table'; $this->main_css_element = '%%order_class%%.et_pb_pricing'; $this->type = 'child'; $this->child_title_var = 'title'; $this->whitelisted_fields = array( 'featured', 'title', 'subtitle', 'currency', 'per', 'sum', 'button_url', 'button_text', 'content_new', ); $this->fields_defaults = array( 'featured' => array( 'off' ), ); $this->advanced_setting_title_text = __( 'New Pricing Table', 'et_builder' ); $this->settings_text = __( 'Pricing Table Settings', 'et_builder' ); $this->main_css_element = '%%order_class%%'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing_heading h2", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'subheader' => array( 'label' => __( 'Subheader', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_best_value", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'currency_frequency' => array( 'label' => __( 'Currency & Frequency', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_dollar_sign, {$this->main_css_element} .et_pb_frequency", ), ), 'price' => array( 'label' => __( 'Price', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_sum", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} .et_pb_pricing li", ), 'line_height' => array( 'range_settings' => array( 'min' => '1', 'max' => '100', 'step' => '1', ), ), ), ), 'background' => array( 'use_background_image' => false, 'css' => array( 'main' => "{$this->main_css_element}.et_pb_pricing_table", ), 'settings' => array( 'color' => 'alpha', ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), 'css' => array( 'main' => ".et_pb_pricing {$this->main_css_element} .et_pb_button", ), ), ), ); } function get_fields() { $fields = array( 'featured' => array( 'label' => __( 'Make This Table Featured', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'basic_option', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'description' => __( 'Featuring a table will make it stand out from the rest.', 'et_builder' ), ), 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define a title for the pricing table.', 'et_builder' ), ), 'subtitle' => array( 'label' => __( 'Subtitle', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define a sub title for the table if desired.', 'et_builder' ), ), 'currency' => array( 'label' => __( 'Currency', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input your desired currency symbol here.', 'et_builder' ), ), 'per' => array( 'label' => __( 'Per', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'If your pricing is subscription based, input the subscription payment cycle here.', 'et_builder' ), ), 'sum' => array( 'label' => __( 'Price', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the value of the product here.', 'et_builder' ), ), 'button_url' => array( 'label' => __( 'Button URL', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the destination URL for the signup button.', 'et_builder' ), ), 'button_text' => array( 'label' => __( 'Button Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Adjust the text used from the signup button.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => sprintf( '%1$s
    + %2$s
    - %3$s', esc_html__( 'Input a list of features that are/are not included in the product. Separate items on a new line, and begin with either a + or - symbol: ', 'et_builder' ), esc_html__( 'Included option', 'et_builder' ), esc_html__( 'Excluded option', 'et_builder' ) ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { global $et_pb_pricing_tables_num, $et_pb_pricing_tables_icon; $featured = $this->shortcode_atts['featured']; $title = $this->shortcode_atts['title']; $subtitle = $this->shortcode_atts['subtitle']; $currency = $this->shortcode_atts['currency']; $per = $this->shortcode_atts['per']; $sum = $this->shortcode_atts['sum']; $button_url = $this->shortcode_atts['button_url']; $button_text = $this->shortcode_atts['button_text']; $button_custom = $this->shortcode_atts['custom_button']; $custom_icon = $this->shortcode_atts['button_icon']; $et_pb_pricing_tables_num++; $module_class = ET_Builder_Element::add_module_order_class( '', $function_name ); $custom_table_icon = 'on' === $button_custom && '' !== $custom_icon ? $custom_icon : $et_pb_pricing_tables_icon; if ( '' !== $button_url && '' !== $button_text ) { $button_text = sprintf( '%2$s', esc_url( $button_url ), esc_html( $button_text ), '' !== $custom_table_icon ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_table_icon ) ) ) : '', '' !== $custom_table_icon ? ' et_pb_custom_button_icon' : '' ); } $output = sprintf( '
    %2$s %3$s
    %6$s%7$s%8$s
      %4$s
    %5$s
    ', ( 'off' !== $featured ? ' et_pb_featured_table' : '' ), ( '' !== $title ? sprintf( '

    %1$s

    ', esc_html( $title ) ) : '' ), ( '' !== $subtitle ? sprintf( '%1$s', esc_html( $subtitle ) ) : '' ), do_shortcode( et_pb_fix_shortcodes( et_pb_extract_items( $content ) ) ), $button_text, ( '' !== $currency ? sprintf( '%1$s', esc_html( $currency ) ) : '' ), ( '' !== $sum ? sprintf( '%1$s', esc_html( $sum ) ) : '' ), ( '' !== $per ? sprintf( '/%1$s', esc_html( $per ) ) : '' ), esc_attr( $module_class ) ); return $output; } } new ET_Builder_Module_Pricing_Tables_Item; class ET_Builder_Module_CTA extends ET_Builder_Module { function init() { $this->name = __( 'Call To Action', 'et_builder' ); $this->slug = 'et_pb_cta'; $this->whitelisted_fields = array( 'title', 'button_url', 'url_new_window', 'button_text', 'use_background_color', 'background_color', 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'max_width', ); $this->fields_defaults = array( 'url_new_window' => array( 'off' ), 'use_background_color' => array( 'on' ), 'background_color' => array( et_builder_accent_color(), 'add_default_setting' ), 'background_layout' => array( 'dark' ), 'text_orientation' => array( 'center' ), ); $this->main_css_element = '%%order_class%%.et_pb_promo'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} h2", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'use_background_color' => false, ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), ), ), ); $this->custom_css_options = array( 'promo_description' => array( 'label' => __( 'Promo Description', 'et_builder' ), 'selector' => '.et_pb_promo_description', ), 'promo_button' => array( 'label' => __( 'Promo Button', 'et_builder' ), 'selector' => '.et_pb_promo_button', ), ); } function get_fields() { $fields = array( 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input your value to action title here.', 'et_builder' ), ), 'button_url' => array( 'label' => __( 'Button URL', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input the destination URL for your CTA button.', 'et_builder' ), ), 'url_new_window' => array( 'label' => __( 'Url Opens', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'In The Same Window', 'et_builder' ), 'on' => __( 'In The New Tab', 'et_builder' ), ), 'description' => __( 'Here you can choose whether or not your link opens in a new window', 'et_builder' ), ), 'button_text' => array( 'label' => __( 'Button Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Input your desired button text, or leave blank for no button.', 'et_builder' ), ), 'use_background_color' => array( 'label' => __( 'Use Background Color', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'color_option', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'affects' => array( '#et_pb_background_color', ), 'description' => __( 'Here you can choose whether background color setting below should be used or not.', 'et_builder' ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'depends_default' => true, 'description' => __( 'Here you can define a custom background color for your CTA.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'This will adjust the alignment of the module text.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input the main text content for your module here.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'max_width' => array( 'label' => __( 'Max Width', 'et_builder' ), 'type' => 'text', 'option_category' => 'layout', 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $title = $this->shortcode_atts['title']; $button_url = $this->shortcode_atts['button_url']; $button_text = $this->shortcode_atts['button_text']; $background_color = $this->shortcode_atts['background_color']; $background_layout = $this->shortcode_atts['background_layout']; $text_orientation = $this->shortcode_atts['text_orientation']; $use_background_color = $this->shortcode_atts['use_background_color']; $url_new_window = $this->shortcode_atts['url_new_window']; $max_width = $this->shortcode_atts['max_width']; $custom_icon = $this->shortcode_atts['button_icon']; $button_custom = $this->shortcode_atts['custom_button']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } if ( '' !== $max_width ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% .et_pb_promo_description', 'declaration' => sprintf( 'max-width: %1$s;%2$s', esc_html( et_builder_process_range_value( $max_width ) ), ( 'center' === $text_orientation ? ' margin: 0 auto;' : '' ) ), ) ); } $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; $output = sprintf( '
    %1$s %2$s
    %3$s ', ( '' !== $title ? '

    ' . esc_html( $title ) . '

    ' : '' ), $this->shortcode_content, ( '' !== $button_url && '' !== $button_text ? sprintf( '%2$s', esc_url( $button_url ), esc_html( $button_text ), ( 'on' === $url_new_window ? ' target="_blank"' : '' ), '' !== $custom_icon && 'on' === $button_custom ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon ) ) ) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '' ) : '' ), esc_attr( $class ), ( 'on' === $use_background_color ? sprintf( ' style="background-color: %1$s;"', esc_attr( $background_color ) ) : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ), ( 'on' !== $use_background_color ? ' et_pb_no_bg' : '' ) ); return $output; } } new ET_Builder_Module_CTA; class ET_Builder_Module_Audio extends ET_Builder_Module { function init() { $this->name = __( 'Audio', 'et_builder' ); $this->slug = 'et_pb_audio'; $this->whitelisted_fields = array( 'audio', 'title', 'artist_name', 'album_name', 'image_url', 'background_color', 'background_layout', 'admin_label', 'module_id', 'module_class', ); $this->fields_defaults = array( 'background_color' => array( et_builder_accent_color(), 'add_default_setting' ), 'background_layout' => array( 'dark' ), ); $this->main_css_element = '%%order_class%%.et_pb_audio_module'; $this->advanced_options = array( 'fonts' => array( 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} h2", ), ), 'caption' => array( 'label' => __( 'Caption', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", 'main' => "{$this->main_css_element} p", ), ), ), 'background' => array( 'settings' => array( 'color' => 'alpha', ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), ); $this->custom_css_options = array( 'audio_cover_art' => array( 'label' => __( 'Audio Cover Art', 'et_builder' ), 'selector' => '.et_pb_audio_cover_art', ), 'audio_content' => array( 'label' => __( 'Audio Content', 'et_builder' ), 'selector' => '.et_pb_audio_module_content', ), 'audio_meta' => array( 'label' => __( 'Audio Meta', 'et_builder' ), 'selector' => '.et_audio_module_meta', ), ); } function get_fields() { $fields = array( 'audio' => array( 'label' => __( 'Audio', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'audio', 'upload_button_text' => __( 'Upload an audio file', 'et_builder' ), 'choose_text' => __( 'Choose an Audio file', 'et_builder' ), 'update_text' => __( 'Set As Audio for the module', 'et_builder' ), 'description' => __( 'Define the audio file for use in the module. To remove an audio file from the module, simply delete the URL from the settings field.', 'et_builder' ), ), 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define a title.', 'et_builder' ), ), 'artist_name' => array( 'label' => __( 'Artist Name', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define an artist name.', 'et_builder' ), ), 'album_name' => array( 'label' => __( 'Album name', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Define an album name.', 'et_builder' ), ), 'image_url' => array( 'label' => __( 'Cover Art Image URL', 'et_builder' ), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => __( 'Upload an image', 'et_builder' ), 'choose_text' => __( 'Choose an Image', 'et_builder' ), 'update_text' => __( 'Set As Image', 'et_builder' ), 'description' => __( 'Upload your desired image, or type in the URL to the image you would like to display.', 'et_builder' ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Define a custom background color for your module, or leave blank to use the default color.', 'et_builder' ), ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $audio = $this->shortcode_atts['audio']; $title = $this->shortcode_atts['title']; $artist_name = $this->shortcode_atts['artist_name']; $album_name = $this->shortcode_atts['album_name']; $image_url = $this->shortcode_atts['image_url']; $background_color = $this->shortcode_atts['background_color']; $background_layout = $this->shortcode_atts['background_layout']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); $meta = $cover_art = ''; $class = " et_pb_module et_pb_bg_layout_{$background_layout}"; if ( 'light' === $background_layout ) { $class .= " et_pb_text_color_dark"; } if ( '' !== $artist_name || '' !== $album_name ) { if ( '' !== $artist_name && '' !== $album_name ) { $album_name = ' | ' . $album_name; } if ( '' !== $artist_name ) { $artist_name = sprintf( _x( 'by %1$s', 'Audio Module meta information', 'et_builder' ), esc_html( $artist_name ) ); } $meta = sprintf( '%1$s%2$s', $artist_name, esc_html( $album_name ) ); $meta = sprintf( '

    %1$s

    ', $meta ); } if ( '' !== $image_url ) { $cover_art = sprintf( '
    ', esc_attr( $image_url ) ); } $output = sprintf( ' %6$s
    %1$s %2$s %3$s
    ', ( '' !== $title ? '

    ' . esc_html( $title ) . '

    ' : '' ), $meta, do_shortcode( sprintf( '[audio src="%1$s" /]', esc_attr( $audio ) ) ), esc_attr( $class ), sprintf( ' style="background-color: %1$s;"', esc_attr( $background_color ) ), $cover_art, ( '' === $image_url ? ' et_pb_audio_no_image' : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ) ); return $output; } } new ET_Builder_Module_Audio; class ET_Builder_Module_Signup extends ET_Builder_Module { function init() { $this->name = __( 'Email Optin', 'et_builder' ); $this->slug = 'et_pb_signup'; $this->whitelisted_fields = array( 'provider', 'feedburner_uri', 'mailchimp_list', 'aweber_list', 'title', 'button_text', 'use_background_color', 'background_color', 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'form_field_background_color', 'form_field_text_color', 'focus_background_color', 'focus_text_color', 'use_focus_border_color', 'focus_border_color', ); $this->fields_defaults = array( 'provider' => array( 'mailchimp' ), 'button_text' => array( __( 'Subscribe', 'et_builder' ) ), 'use_background_color' => array( 'on' ), 'background_color' => array( et_builder_accent_color(), 'add_default_setting' ), 'background_layout' => array( 'dark' ), 'text_orientation' => array( 'left' ), 'use_focus_border_color' => array( 'off' ), ); $this->main_css_element = '%%order_class%%.et_pb_subscribe'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} h2", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), ), ), ); $this->custom_css_options = array( 'newsletter_description' => array( 'label' => __( 'Newsletter Description', 'et_builder' ), 'selector' => '.et_pb_newsletter_description', ), 'newsletter_form' => array( 'label' => __( 'Newsletter Form', 'et_builder' ), 'selector' => '.et_pb_newsletter_form', ), 'newsletter_button' => array( 'label' => __( 'Newsletter Button', 'et_builder' ), 'selector' => '.et_pb_newsletter_button', ), ); } function get_fields() { $et_pb_mailchimp_lists_options = array( 'none' => __( 'Select the list', 'et_builder' ) ); $et_pb_aweber_lists_options = $et_pb_mailchimp_lists_options; $et_pb_mailchimp_lists = et_pb_get_mailchimp_lists(); if ( $et_pb_mailchimp_lists ) { foreach ( $et_pb_mailchimp_lists as $et_pb_mailchimp_list_key => $et_pb_mailchimp_list_name ) { $et_pb_mailchimp_lists_options[ $et_pb_mailchimp_list_key ] = $et_pb_mailchimp_list_name; } } $et_pb_aweber_lists = et_pb_get_aweber_lists(); if ( $et_pb_aweber_lists ) { foreach ( $et_pb_aweber_lists as $et_pb_aweber_list_key => $et_pb_aweber_list_name ) { $et_pb_aweber_lists_options[ $et_pb_aweber_list_key ] = $et_pb_aweber_list_name; } } $fields = array( 'provider' => array( 'label' => __( 'Service Provider', 'et_builder' ), 'type' => 'select', 'option_category' => 'basic_option', 'options' => array( 'mailchimp' => __( 'MailChimp', 'et_builder' ), 'feedburner' => __( 'FeedBurner', 'et_builder' ), 'aweber' => __( 'Aweber', 'et_builder' ), ), 'affects' => array( '#et_pb_feedburner_uri', '#et_pb_mailchimp_list', '#et_pb_aweber_list', ), 'description' => __( 'Here you can choose a service provider.', 'et_builder' ), ), 'feedburner_uri' => array( 'label' => __( 'Feed Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'depends_show_if' => 'feedburner', 'description' => __( sprintf( 'Enter Feed Title.', esc_url( 'http://feedburner.google.com/fb/a/myfeeds' ) ), 'et_builder' ), ), 'mailchimp_list' => array( 'label' => __( 'MailChimp lists', 'et_builder' ), 'type' => 'select', 'option_category' => 'basic_option', 'options' => $et_pb_mailchimp_lists_options, 'description' => __( "Here you can choose MailChimp list to add customers to. If you don't see any lists here, you need to make sure MailChimp API key is set in ePanel and you have at least one list on a MailChimp account. If you added new list, but it doesn't appear here, activate 'Regenerate MailChimp Lists' option in ePanel. Don't forget to disable it once the list has been regenerated.", 'et_builder' ), 'depends_show_if' => 'mailchimp', ), 'aweber_list' => array( 'label' => __( 'Aweber lists', 'et_builder' ), 'type' => 'select', 'option_category' => 'basic_option', 'options' => $et_pb_aweber_lists_options, 'description' => __( "Here you can choose Aweber list to add customers to. If you don't see any lists here, you need to make sure Aweber is set up properly in ePanel and you have at least one list on a Aweber account. If you added new list, but it doesn't appear here, activate 'Regenerate Aweber Lists' option in ePanel. Don't forget to disable it once the list has been regenerated.", 'et_builder' ), 'depends_show_if' => 'aweber', ), 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Choose a title of your signup box.', 'et_builder' ), ), 'button_text' => array( 'label' => __( 'Button Text', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Here you can change the text used for the signup button.', 'et_builder' ), ), 'use_background_color' => array( 'label' => __( 'Use Background Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'affects' => array( '#et_pb_background_color', ), 'description' => __( 'Here you can choose whether background color setting below should be used or not.', 'et_builder' ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Define a custom background color for your module, or leave blank to use the default color.', 'et_builder' ), 'depends_default' => true, ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'configuration', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'Here you can adjust the alignment of your text.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input the main text content for your module here.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'form_field_background_color' => array( 'label' => __( 'Form Field Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'form_field_text_color' => array( 'label' => __( 'Form Field Text Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'focus_background_color' => array( 'label' => __( 'Focus Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'focus_text_color' => array( 'label' => __( 'Focus Text Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'use_focus_border_color' => array( 'label' => __( 'Use Focus Border Color', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'color_option', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_focus_border_color', ), 'tab_slug' => 'advanced', ), 'focus_border_color' => array( 'label' => __( 'Focus Border Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'depends_default' => true, 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $title = $this->shortcode_atts['title']; $button_text = $this->shortcode_atts['button_text']; $background_color = $this->shortcode_atts['background_color']; $mailchimp_list = $this->shortcode_atts['mailchimp_list']; $aweber_list = $this->shortcode_atts['aweber_list']; $text_orientation = $this->shortcode_atts['text_orientation']; $use_background_color = $this->shortcode_atts['use_background_color']; $provider = $this->shortcode_atts['provider']; $feedburner_uri = $this->shortcode_atts['feedburner_uri']; $background_layout = $this->shortcode_atts['background_layout']; $form_field_background_color = $this->shortcode_atts['form_field_background_color']; $form_field_text_color = $this->shortcode_atts['form_field_text_color']; $focus_background_color = $this->shortcode_atts['focus_background_color']; $focus_text_color = $this->shortcode_atts['focus_text_color']; $use_focus_border_color = $this->shortcode_atts['use_focus_border_color']; $focus_border_color = $this->shortcode_atts['focus_border_color']; $button_custom = $this->shortcode_atts['custom_button']; $custom_icon = $this->shortcode_atts['button_icon']; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $focus_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $focus_background_color ) ), ) ); } if ( '' !== $focus_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'color: %1$s;', esc_html( $focus_text_color ) ), ) ); } if ( 'off' !== $use_focus_border_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'border: 1px solid %1$s !important;', esc_html( $focus_border_color ) ), ) ); } if ( '' !== $form_field_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% input[type="text"], %%order_class%% textarea', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $form_field_background_color ) ), ) ); } if ( '' !== $form_field_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% input[type="text"], %%order_class%% textarea', 'declaration' => sprintf( 'color: %1$s;', esc_html( $form_field_text_color ) ), ) ); } if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; $form = ''; $firstname = __( 'First Name', 'et_builder' ); $lastname = __( 'Last Name', 'et_builder' ); $email_address = __( 'Email Address', 'et_builder' ); switch ( $provider ) { case 'mailchimp' : if ( ! in_array( $mailchimp_list, array( '', 'none' ) ) ) { $form = sprintf( '

    %1$s

    ', esc_html( $button_text ), ( ! in_array( $mailchimp_list, array( '', 'none' ) ) ? esc_attr( $mailchimp_list ) : '' ), esc_html( $firstname ), esc_attr( $firstname ), esc_html( $lastname ), esc_attr( $lastname ), esc_html( $email_address ), esc_attr( $email_address ), '' !== $custom_icon && 'on' === $button_custom ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon ) ) ) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '' ); } break; case 'feedburner': $form = sprintf( '

    ', esc_html( $button_text ), esc_html( $email_address ), esc_attr( $email_address ), esc_attr( $feedburner_uri ), esc_attr( get_locale() ), '' !== $custom_icon && 'on' === $button_custom ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon ) ) ) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '' ); break; case 'aweber' : $firstname = __( 'Name', 'et_builder' ); if ( ! in_array( $aweber_list, array( '', 'none' ) ) ) { $form = sprintf( '

    %1$s

    ', esc_html( $button_text ), ( ! in_array( $aweber_list, array( '', 'none' ) ) ? esc_attr( $aweber_list ) : '' ), esc_html( $firstname ), esc_attr( $firstname ), esc_html( $email_address ), esc_attr( $email_address ), '' !== $custom_icon && 'on' === $button_custom ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon ) ) ) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '' ); } break; } $output = sprintf( '
    %1$s %2$s
    %3$s ', ( '' !== $title ? '

    ' . esc_html( $title ) . '

    ' : '' ), $this->shortcode_content, $form, esc_attr( $class ), ( 'on' === $use_background_color ? sprintf( ' style="background-color: %1$s;"', esc_attr( $background_color ) ) : '' ), ( '' !== $module_id ? sprintf( ' id="%1$s"', esc_attr( $module_id ) ) : '' ), ( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' ), ( 'on' !== $use_background_color ? ' et_pb_no_bg' : '' ) ); return $output; } } new ET_Builder_Module_Signup; class ET_Builder_Module_Login extends ET_Builder_Module { function init() { $this->name = __( 'Login', 'et_builder' ); $this->slug = 'et_pb_login'; $this->whitelisted_fields = array( 'title', 'current_page_redirect', 'use_background_color', 'background_color', 'background_layout', 'text_orientation', 'content_new', 'admin_label', 'module_id', 'module_class', 'form_field_background_color', 'form_field_text_color', 'focus_background_color', 'focus_text_color', 'use_focus_border_color', 'focus_border_color', ); $this->fields_defaults = array( 'current_page_redirect' => array( 'off' ), 'use_background_color' => array( 'on' ), 'background_color' => array( et_builder_accent_color(), 'add_default_setting' ), 'background_layout' => array( 'dark' ), 'text_orientation' => array( 'left' ), 'use_focus_border_color' => array( 'off' ), ); $this->main_css_element = '%%order_class%%.et_pb_login'; $this->advanced_options = array( 'fonts' => array( 'header' => array( 'label' => __( 'Header', 'et_builder' ), 'css' => array( 'main' => "{$this->main_css_element} h2", ), ), 'body' => array( 'label' => __( 'Body', 'et_builder' ), 'css' => array( 'line_height' => "{$this->main_css_element} p", ), ), ), 'border' => array(), 'custom_margin_padding' => array( 'css' => array( 'important' => 'all', ), ), 'button' => array( 'button' => array( 'label' => __( 'Button', 'et_builder' ), ), ), ); $this->custom_css_options = array( 'newsletter_description' => array( 'label' => __( 'Newsletter Description', 'et_builder' ), 'selector' => '.et_pb_newsletter_description', ), 'newsletter_form' => array( 'label' => __( 'Newsletter Form', 'et_builder' ), 'selector' => '.et_pb_newsletter_form', ), 'newsletter_button' => array( 'label' => __( 'Newsletter Button', 'et_builder' ), 'selector' => '.et_pb_newsletter_button', ), ); } function get_fields() { $fields = array( 'title' => array( 'label' => __( 'Title', 'et_builder' ), 'type' => 'text', 'option_category' => 'basic_option', 'description' => __( 'Choose a title of your login box.', 'et_builder' ), ), 'current_page_redirect' => array( 'label' => __( 'Redirect To The Current Page', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'description' => __( 'Here you can choose whether the user should be redirected to the current page.', 'et_builder' ), ), 'use_background_color' => array( 'label' => __( 'Use Background Color', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'color_option', 'options' => array( 'on' => __( 'Yes', 'et_builder' ), 'off' => __( 'No', 'et_builder' ), ), 'affects' => array( '#et_pb_background_color', ), 'description' => __( 'Here you can choose whether background color setting below should be used or not.', 'et_builder' ), ), 'background_color' => array( 'label' => __( 'Background Color', 'et_builder' ), 'type' => 'color-alpha', 'description' => __( 'Define a custom background color for your module, or leave blank to use the default color.', 'et_builder' ), 'depends_default' => true, ), 'background_layout' => array( 'label' => __( 'Text Color', 'et_builder' ), 'type' => 'select', 'option_category' => 'color_option', 'options' => array( 'dark' => __( 'Light', 'et_builder' ), 'light' => __( 'Dark', 'et_builder' ), ), 'description' => __( 'Here you can choose whether your text should be light or dark. If you are working with a dark background, then your text should be light. If your background is light, then your text should be set to dark.', 'et_builder' ), ), 'text_orientation' => array( 'label' => __( 'Text Orientation', 'et_builder' ), 'type' => 'select', 'option_category' => 'layout', 'options' => et_builder_get_text_orientation_options(), 'description' => __( 'Here you can adjust the alignment of your text.', 'et_builder' ), ), 'content_new' => array( 'label' => __( 'Content', 'et_builder' ), 'type' => 'tiny_mce', 'option_category' => 'basic_option', 'description' => __( 'Input the main text content for your module here.', 'et_builder' ), ), 'admin_label' => array( 'label' => __( 'Admin Label', 'et_builder' ), 'type' => 'text', 'description' => __( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ), ), 'module_id' => array( 'label' => __( 'CSS ID', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter an optional CSS ID to be used for this module. An ID can be used to create custom CSS styling, or to create links to particular sections of your page.', 'et_builder' ), ), 'module_class' => array( 'label' => __( 'CSS Class', 'et_builder' ), 'type' => 'text', 'option_category' => 'configuration', 'description' => __( 'Enter optional CSS classes to be used for this module. A CSS class can be used to create custom CSS styling. You can add multiple classes, separated with a space.', 'et_builder' ), ), 'form_field_background_color' => array( 'label' => __( 'Form Field Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'form_field_text_color' => array( 'label' => __( 'Form Field Text Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'focus_background_color' => array( 'label' => __( 'Focus Background Color', 'et_builder' ), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'focus_text_color' => array( 'label' => __( 'Focus Text Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'tab_slug' => 'advanced', ), 'use_focus_border_color' => array( 'label' => __( 'Use Focus Border Color', 'et_builder' ), 'type' => 'yes_no_button', 'option_category' => 'color_option', 'options' => array( 'off' => __( 'No', 'et_builder' ), 'on' => __( 'Yes', 'et_builder' ), ), 'affects' => array( '#et_pb_focus_border_color', ), 'tab_slug' => 'advanced', ), 'focus_border_color' => array( 'label' => __( 'Focus Border Color', 'et_builder' ), 'type' => 'color', 'custom_color' => true, 'depends_default' => true, 'tab_slug' => 'advanced', ), ); return $fields; } function shortcode_callback( $atts, $content = null, $function_name ) { $module_id = $this->shortcode_atts['module_id']; $module_class = $this->shortcode_atts['module_class']; $title = $this->shortcode_atts['title']; $background_color = $this->shortcode_atts['background_color']; $background_layout = $this->shortcode_atts['background_layout']; $text_orientation = $this->shortcode_atts['text_orientation']; $use_background_color = $this->shortcode_atts['use_background_color']; $current_page_redirect = $this->shortcode_atts['current_page_redirect']; $form_field_background_color = $this->shortcode_atts['form_field_background_color']; $form_field_text_color = $this->shortcode_atts['form_field_text_color']; $focus_background_color = $this->shortcode_atts['focus_background_color']; $focus_text_color = $this->shortcode_atts['focus_text_color']; $use_focus_border_color = $this->shortcode_atts['use_focus_border_color']; $focus_border_color = $this->shortcode_atts['focus_border_color']; $button_custom = $this->shortcode_atts['custom_button']; $custom_icon = $this->shortcode_atts['button_icon']; $content = $this->shortcode_content; $module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name ); if ( '' !== $focus_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $focus_background_color ) ), ) ); } if ( '' !== $focus_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'color: %1$s;', esc_html( $focus_text_color ) ), ) ); } if ( 'off' !== $use_focus_border_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%%.et_pb_newsletter_form p input:focus', 'declaration' => sprintf( 'border: 1px solid %1$s !important;', esc_html( $focus_border_color ) ), ) ); } if ( '' !== $form_field_background_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% input[type="text"], %%order_class%% textarea, %%order_class%% .input', 'declaration' => sprintf( 'background-color: %1$s;', esc_html( $form_field_background_color ) ), ) ); } if ( '' !== $form_field_text_color ) { ET_Builder_Element::set_style( $function_name, array( 'selector' => '%%order_class%% input[type="text"], %%order_class%% textarea, %%order_class%% .input', 'declaration' => sprintf( 'color: %1$s;', esc_html( $form_field_text_color ) ), ) ); } if ( is_rtl() && 'left' === $text_orientation ) { $text_orientation = 'right'; } $redirect_url = 'on' === $current_page_redirect ? ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] : ''; if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $content .= sprintf( '
    %1$s %3$s', sprintf( __( 'Logged in as %1$s', 'et_builder' ), esc_html( $current_user->display_name ) ), esc_url( wp_logout_url( $redirect_url ) ), esc_html__( 'Log out', 'et_builder' ) ); } $class = " et_pb_module et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}"; $form = ''; if ( !is_user_logged_in() ) { $username = __( 'Username', 'et_builder' ); $password = __( 'Password', 'et_builder' ); $form = sprintf( ' ', __( 'Forgot your password?', 'et_builder' ), esc_url( wp_lostpassword_url() ), esc_html( $username ), esc_attr( $username ), esc_html( $password ), esc_attr( $password ), esc_url( site_url( 'wp-login.php', 'login_post' ) ), __( 'Login', 'et_builder' ), ( 'on' === $current_page_redirect ? sprintf( '', $redirect_url ) : '' ), '' !== $custom_icon && 'on' === $button_custom ? sprintf( ' data-icon="%1$s"', esc_attr( et_pb_process_font_icon( $custom_icon ) ) ) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '' ); } $output = sprintf( '