'sticky_pseudo_selector_location' => 'prefix',
'css_property' => 'color',
'render_slug' => $render_slug,
// Quote Icon Background Color.
'base_attr_name' => 'quote_icon_background_color',
'selector' => '%%order_class%%.et_pb_testimonial:before',
'hover_pseudo_selector_location' => 'suffix',
'sticky_pseudo_selector_location' => 'prefix',
'css_property' => 'background-color',
'render_slug' => $render_slug,
// $icon_selector = '%%order_class%%:before';.
if ( 'off' !== $quote_icon && 'off' !== $use_icon_font_size ) {
'base_attr_name' => 'icon_font_size',
'selector' => '%%order_class%%:before',
'hover_pseudo_selector_location' => 'suffix',
'sticky_pseudo_selector_location' => 'prefix',
'render_slug' => $render_slug,
'processor_declaration_format' => 'font-size:%1$s; border-radius:%1$s; top:-%2$s; margin-left:-%2$s;',
// processed attr value can't be directly assigned to single css property so
// custom processor is needed to render this attr.
'ET_Builder_Module_Helper_Style_Processor',
'process_overlay_icon_font_size',
$video_background = $this->video_background();
$parallax_image_background = $this->get_parallax_image_background();
$portrait_image = $multi_view->render_element(
'class' => 'et_pb_testimonial_portrait',
'background-image' => 'url({{portrait_url}})',
'required' => 'portrait_url',
$job_title = $multi_view->render_element(
'content' => '{{job_title}}',
'class' => 'et_pb_testimonial_position',
$metas['job_title'] = $job_title;
$company_name = $multi_view->render_element(
'content' => '{{company_name}}',
'class' => 'et_pb_testimonial_company',
$metas['company_name'] = $company_name;
$author = $multi_view->render_element(
'content' => '{{author}}',
'class' => 'et_pb_testimonial_author',
// Images: Add CSS Filters and Mix Blend Mode rules (if set)
if ( array_key_exists( 'image', $this->advanced_fields ) && array_key_exists( 'css', $this->advanced_fields['image'] ) ) {
$this->generate_css_filters(
self::$data_utils->array_get( $this->advanced_fields['image']['css'], 'main', '%%order_class%%' )
$this->get_text_orientation_classname(),
// Background layout class names.
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
$this->add_classname( $background_layout_class_names );
if ( ! $multi_view->has_value( 'quote_icon', 'on', 'desktop' ) ) {
$this->add_classname( 'et_pb_icon_off' );
if ( ! $multi_view->has_value( 'portrait_url', 'desktop' ) ) {
$this->add_classname( 'et_pb_testimonial_no_image' );
if ( 'off' === $use_background_color ) {
$this->add_classname( 'et_pb_testimonial_no_bg' );
// Background layout data attributes.
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
if ( 'on' === $use_background_color ) {
'selector' => '%%order_class%%.et_pb_testimonial',
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $background_color )
ET_Builder_Element::set_style( $render_slug, $el_style );
if ( et_builder_is_hover_enabled( 'background_color', $this->props ) ) {
'selector' => $this->add_hover_to_order_class( '%%order_class%%.et_pb_testimonial' ),
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $background_color_hover )
ET_Builder_Element::set_style( $render_slug, $el_style );
$multi_view_testimonial_content = $multi_view->render_element(
'content' => '{{content}}',
'class' => 'et_pb_testimonial_content',
$multi_view_icon_off_data_attr = $multi_view->render_attrs(
'et_pb_icon_off' => array(
'et_pb_testimonial_no_image' => array(
'portrait_url' => '__empty',
// Added span wrapper for comma between Job Title and Company Title
$testimonials_metas_string = implode( '<span class="et_pb_testimonial_separator">,</span> ', $metas );
'<div%3$s class="%4$s"%10$s%11$s>
<div class="et_pb_testimonial_description">
<div class="et_pb_testimonial_description_inner">%1$s</div> <!-- .et_pb_testimonial_description_inner -->
<p class="et_pb_testimonial_meta">%5$s</p>
</div> <!-- .et_pb_testimonial_description -->
</div> <!-- .et_pb_testimonial -->',
$multi_view_testimonial_content,
et_core_esc_previously( $author ),
$this->module_classname( $render_slug ),
et_core_esc_previously( $testimonials_metas_string ), // #5
$parallax_image_background,
et_core_esc_previously( $data_background_layout ), // #10
et_core_esc_previously( $multi_view_icon_off_data_attr )
* Filter multi view value.
* @see ET_Builder_Module_Helper_MultiViewOptions::filter_value
* @param mixed $raw_value Props raw value.
* @type string $context Context param: content, attrs, visibility, classes.
* @type string $name Module options props name.
* @type string $mode Current data mode: desktop, hover, tablet, phone.
* @type string $attr_key Attribute key for attrs context data. Example: src, class, etc.
* @type string $attr_sub_key Attribute sub key that availabe when passing attrs value as array such as styes. Example: padding-top, margin-botton, etc.
* @param ET_Builder_Module_Helper_MultiViewOptions $multi_view Multiview object instance.
public function multi_view_filter_value( $raw_value, $args, $multi_view ) {
$context = et_()->array_get( $args, 'context', '' );
$name = et_()->array_get( $args, 'name', '' );
$mode = et_()->array_get( $args, 'mode', '' );
$url = $this->props['url'];
$link_target = 'on' === $this->props['url_new_window'] ? 'target="_blank"' : '';
$fields_need_escape = array(
if ( $raw_value && 'content' === $context && in_array( $name, $fields_need_escape, true ) ) {
$raw_value = $this->_esc_attr( $multi_view->get_name_by_mode( $name, $mode ), 'none', $raw_value );
if ( $url && $raw_value ) {
if ( 'author' === $name && ! $this->_esc_attr( $multi_view->get_name_by_mode( 'company_name', $mode ) ) ) {
'<a href="%2$s" %3$s>%1$s</a>',
et_core_intentionally_unescaped( $link_target, 'fixed_string' )
} elseif ( 'company_name' === $name ) {
'<a href="%2$s" %3$s>%1$s</a>',
et_core_intentionally_unescaped( $link_target, 'fixed_string' )
new ET_Builder_Module_Testimonial();