Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder/module
File: Testimonial.php
'sticky_pseudo_selector_location' => 'prefix',
[500] Fix | Delete
'css_property' => 'color',
[501] Fix | Delete
'render_slug' => $render_slug,
[502] Fix | Delete
'type' => 'color',
[503] Fix | Delete
)
[504] Fix | Delete
);
[505] Fix | Delete
[506] Fix | Delete
// Quote Icon Background Color.
[507] Fix | Delete
$this->generate_styles(
[508] Fix | Delete
array(
[509] Fix | Delete
'base_attr_name' => 'quote_icon_background_color',
[510] Fix | Delete
'selector' => '%%order_class%%.et_pb_testimonial:before',
[511] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[512] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[513] Fix | Delete
'css_property' => 'background-color',
[514] Fix | Delete
'render_slug' => $render_slug,
[515] Fix | Delete
'type' => 'color',
[516] Fix | Delete
)
[517] Fix | Delete
);
[518] Fix | Delete
[519] Fix | Delete
// Icon Size.
[520] Fix | Delete
// $icon_selector = '%%order_class%%:before';.
[521] Fix | Delete
if ( 'off' !== $quote_icon && 'off' !== $use_icon_font_size ) {
[522] Fix | Delete
// Icon Font Size.
[523] Fix | Delete
$this->generate_styles(
[524] Fix | Delete
array(
[525] Fix | Delete
'base_attr_name' => 'icon_font_size',
[526] Fix | Delete
'selector' => '%%order_class%%:before',
[527] Fix | Delete
'hover_pseudo_selector_location' => 'suffix',
[528] Fix | Delete
'sticky_pseudo_selector_location' => 'prefix',
[529] Fix | Delete
'render_slug' => $render_slug,
[530] Fix | Delete
'type' => 'range',
[531] Fix | Delete
'processor_declaration_format' => 'font-size:%1$s; border-radius:%1$s; top:-%2$s; margin-left:-%2$s;',
[532] Fix | Delete
[533] Fix | Delete
// processed attr value can't be directly assigned to single css property so
[534] Fix | Delete
// custom processor is needed to render this attr.
[535] Fix | Delete
'processor' => array(
[536] Fix | Delete
'ET_Builder_Module_Helper_Style_Processor',
[537] Fix | Delete
'process_overlay_icon_font_size',
[538] Fix | Delete
),
[539] Fix | Delete
)
[540] Fix | Delete
);
[541] Fix | Delete
}
[542] Fix | Delete
[543] Fix | Delete
$video_background = $this->video_background();
[544] Fix | Delete
$parallax_image_background = $this->get_parallax_image_background();
[545] Fix | Delete
[546] Fix | Delete
$portrait_image = $multi_view->render_element(
[547] Fix | Delete
array(
[548] Fix | Delete
'tag' => 'div',
[549] Fix | Delete
'attrs' => array(
[550] Fix | Delete
'class' => 'et_pb_testimonial_portrait',
[551] Fix | Delete
),
[552] Fix | Delete
'styles' => array(
[553] Fix | Delete
'background-image' => 'url({{portrait_url}})',
[554] Fix | Delete
),
[555] Fix | Delete
'required' => 'portrait_url',
[556] Fix | Delete
)
[557] Fix | Delete
);
[558] Fix | Delete
[559] Fix | Delete
$metas = array();
[560] Fix | Delete
[561] Fix | Delete
// Job title data.
[562] Fix | Delete
$job_title = $multi_view->render_element(
[563] Fix | Delete
array(
[564] Fix | Delete
'content' => '{{job_title}}',
[565] Fix | Delete
'attrs' => array(
[566] Fix | Delete
'class' => 'et_pb_testimonial_position',
[567] Fix | Delete
),
[568] Fix | Delete
)
[569] Fix | Delete
);
[570] Fix | Delete
[571] Fix | Delete
if ( $job_title ) {
[572] Fix | Delete
$metas['job_title'] = $job_title;
[573] Fix | Delete
}
[574] Fix | Delete
[575] Fix | Delete
// Company name data.
[576] Fix | Delete
$company_name = $multi_view->render_element(
[577] Fix | Delete
array(
[578] Fix | Delete
'content' => '{{company_name}}',
[579] Fix | Delete
'attrs' => array(
[580] Fix | Delete
'class' => 'et_pb_testimonial_company',
[581] Fix | Delete
),
[582] Fix | Delete
)
[583] Fix | Delete
);
[584] Fix | Delete
[585] Fix | Delete
if ( $company_name ) {
[586] Fix | Delete
$metas['company_name'] = $company_name;
[587] Fix | Delete
}
[588] Fix | Delete
[589] Fix | Delete
// Author data.
[590] Fix | Delete
$author = $multi_view->render_element(
[591] Fix | Delete
array(
[592] Fix | Delete
'tag' => 'span',
[593] Fix | Delete
'content' => '{{author}}',
[594] Fix | Delete
'attrs' => array(
[595] Fix | Delete
'class' => 'et_pb_testimonial_author',
[596] Fix | Delete
),
[597] Fix | Delete
)
[598] Fix | Delete
);
[599] Fix | Delete
[600] Fix | Delete
// Images: Add CSS Filters and Mix Blend Mode rules (if set)
[601] Fix | Delete
if ( array_key_exists( 'image', $this->advanced_fields ) && array_key_exists( 'css', $this->advanced_fields['image'] ) ) {
[602] Fix | Delete
$this->add_classname(
[603] Fix | Delete
$this->generate_css_filters(
[604] Fix | Delete
$render_slug,
[605] Fix | Delete
'child_',
[606] Fix | Delete
self::$data_utils->array_get( $this->advanced_fields['image']['css'], 'main', '%%order_class%%' )
[607] Fix | Delete
)
[608] Fix | Delete
);
[609] Fix | Delete
}
[610] Fix | Delete
[611] Fix | Delete
// Module classnames
[612] Fix | Delete
$this->add_classname(
[613] Fix | Delete
array(
[614] Fix | Delete
'clearfix',
[615] Fix | Delete
$this->get_text_orientation_classname(),
[616] Fix | Delete
)
[617] Fix | Delete
);
[618] Fix | Delete
[619] Fix | Delete
// Background layout class names.
[620] Fix | Delete
$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
[621] Fix | Delete
$this->add_classname( $background_layout_class_names );
[622] Fix | Delete
[623] Fix | Delete
if ( ! $multi_view->has_value( 'quote_icon', 'on', 'desktop' ) ) {
[624] Fix | Delete
$this->add_classname( 'et_pb_icon_off' );
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
if ( ! $multi_view->has_value( 'portrait_url', 'desktop' ) ) {
[628] Fix | Delete
$this->add_classname( 'et_pb_testimonial_no_image' );
[629] Fix | Delete
}
[630] Fix | Delete
[631] Fix | Delete
if ( 'off' === $use_background_color ) {
[632] Fix | Delete
$this->add_classname( 'et_pb_testimonial_no_bg' );
[633] Fix | Delete
}
[634] Fix | Delete
[635] Fix | Delete
// Background layout data attributes.
[636] Fix | Delete
$data_background_layout = et_pb_background_layout_options()->get_background_layout_attrs( $this->props );
[637] Fix | Delete
[638] Fix | Delete
if ( 'on' === $use_background_color ) {
[639] Fix | Delete
$el_style = array(
[640] Fix | Delete
'selector' => '%%order_class%%.et_pb_testimonial',
[641] Fix | Delete
'declaration' => sprintf(
[642] Fix | Delete
'background-color: %1$s;',
[643] Fix | Delete
esc_html( $background_color )
[644] Fix | Delete
),
[645] Fix | Delete
);
[646] Fix | Delete
ET_Builder_Element::set_style( $render_slug, $el_style );
[647] Fix | Delete
[648] Fix | Delete
if ( et_builder_is_hover_enabled( 'background_color', $this->props ) ) {
[649] Fix | Delete
$el_style = array(
[650] Fix | Delete
'selector' => $this->add_hover_to_order_class( '%%order_class%%.et_pb_testimonial' ),
[651] Fix | Delete
'declaration' => sprintf(
[652] Fix | Delete
'background-color: %1$s;',
[653] Fix | Delete
esc_html( $background_color_hover )
[654] Fix | Delete
),
[655] Fix | Delete
);
[656] Fix | Delete
ET_Builder_Element::set_style( $render_slug, $el_style );
[657] Fix | Delete
}
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
$multi_view_testimonial_content = $multi_view->render_element(
[661] Fix | Delete
array(
[662] Fix | Delete
'tag' => 'div',
[663] Fix | Delete
'content' => '{{content}}',
[664] Fix | Delete
'attrs' => array(
[665] Fix | Delete
'class' => 'et_pb_testimonial_content',
[666] Fix | Delete
),
[667] Fix | Delete
)
[668] Fix | Delete
);
[669] Fix | Delete
[670] Fix | Delete
$multi_view_icon_off_data_attr = $multi_view->render_attrs(
[671] Fix | Delete
array(
[672] Fix | Delete
'classes' => array(
[673] Fix | Delete
'et_pb_icon_off' => array(
[674] Fix | Delete
'quote_icon' => 'off',
[675] Fix | Delete
),
[676] Fix | Delete
'et_pb_testimonial_no_image' => array(
[677] Fix | Delete
'portrait_url' => '__empty',
[678] Fix | Delete
),
[679] Fix | Delete
),
[680] Fix | Delete
)
[681] Fix | Delete
);
[682] Fix | Delete
// Added span wrapper for comma between Job Title and Company Title
[683] Fix | Delete
$testimonials_metas_string = implode( '<span class="et_pb_testimonial_separator">,</span> ', $metas );
[684] Fix | Delete
$output = sprintf(
[685] Fix | Delete
'<div%3$s class="%4$s"%10$s%11$s>
[686] Fix | Delete
%9$s
[687] Fix | Delete
%8$s
[688] Fix | Delete
%7$s
[689] Fix | Delete
<div class="et_pb_testimonial_description">
[690] Fix | Delete
<div class="et_pb_testimonial_description_inner">%1$s</div> <!-- .et_pb_testimonial_description_inner -->
[691] Fix | Delete
%2$s
[692] Fix | Delete
<p class="et_pb_testimonial_meta">%5$s</p>
[693] Fix | Delete
</div> <!-- .et_pb_testimonial_description -->
[694] Fix | Delete
</div> <!-- .et_pb_testimonial -->',
[695] Fix | Delete
$multi_view_testimonial_content,
[696] Fix | Delete
et_core_esc_previously( $author ),
[697] Fix | Delete
$this->module_id(),
[698] Fix | Delete
$this->module_classname( $render_slug ),
[699] Fix | Delete
et_core_esc_previously( $testimonials_metas_string ), // #5
[700] Fix | Delete
'', // Deprecated
[701] Fix | Delete
$portrait_image,
[702] Fix | Delete
$video_background,
[703] Fix | Delete
$parallax_image_background,
[704] Fix | Delete
et_core_esc_previously( $data_background_layout ), // #10
[705] Fix | Delete
et_core_esc_previously( $multi_view_icon_off_data_attr )
[706] Fix | Delete
);
[707] Fix | Delete
[708] Fix | Delete
return $output;
[709] Fix | Delete
}
[710] Fix | Delete
[711] Fix | Delete
/**
[712] Fix | Delete
* Filter multi view value.
[713] Fix | Delete
*
[714] Fix | Delete
* @since 3.27.1
[715] Fix | Delete
*
[716] Fix | Delete
* @see ET_Builder_Module_Helper_MultiViewOptions::filter_value
[717] Fix | Delete
*
[718] Fix | Delete
* @param mixed $raw_value Props raw value.
[719] Fix | Delete
* @param array $args {
[720] Fix | Delete
* Context data.
[721] Fix | Delete
*
[722] Fix | Delete
* @type string $context Context param: content, attrs, visibility, classes.
[723] Fix | Delete
* @type string $name Module options props name.
[724] Fix | Delete
* @type string $mode Current data mode: desktop, hover, tablet, phone.
[725] Fix | Delete
* @type string $attr_key Attribute key for attrs context data. Example: src, class, etc.
[726] Fix | Delete
* @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.
[727] Fix | Delete
* }
[728] Fix | Delete
* @param ET_Builder_Module_Helper_MultiViewOptions $multi_view Multiview object instance.
[729] Fix | Delete
*
[730] Fix | Delete
* @return mixed
[731] Fix | Delete
*/
[732] Fix | Delete
public function multi_view_filter_value( $raw_value, $args, $multi_view ) {
[733] Fix | Delete
$context = et_()->array_get( $args, 'context', '' );
[734] Fix | Delete
$name = et_()->array_get( $args, 'name', '' );
[735] Fix | Delete
$mode = et_()->array_get( $args, 'mode', '' );
[736] Fix | Delete
$url = $this->props['url'];
[737] Fix | Delete
$link_target = 'on' === $this->props['url_new_window'] ? 'target="_blank"' : '';
[738] Fix | Delete
$fields_need_escape = array(
[739] Fix | Delete
'author',
[740] Fix | Delete
'job_title',
[741] Fix | Delete
'company_name',
[742] Fix | Delete
);
[743] Fix | Delete
[744] Fix | Delete
if ( ! $raw_value ) {
[745] Fix | Delete
return $raw_value;
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
if ( $raw_value && 'content' === $context && in_array( $name, $fields_need_escape, true ) ) {
[749] Fix | Delete
$raw_value = $this->_esc_attr( $multi_view->get_name_by_mode( $name, $mode ), 'none', $raw_value );
[750] Fix | Delete
[751] Fix | Delete
if ( $url && $raw_value ) {
[752] Fix | Delete
if ( 'author' === $name && ! $this->_esc_attr( $multi_view->get_name_by_mode( 'company_name', $mode ) ) ) {
[753] Fix | Delete
$raw_value = sprintf(
[754] Fix | Delete
'<a href="%2$s" %3$s>%1$s</a>',
[755] Fix | Delete
$raw_value,
[756] Fix | Delete
esc_url( $url ),
[757] Fix | Delete
et_core_intentionally_unescaped( $link_target, 'fixed_string' )
[758] Fix | Delete
);
[759] Fix | Delete
} elseif ( 'company_name' === $name ) {
[760] Fix | Delete
$raw_value = sprintf(
[761] Fix | Delete
'<a href="%2$s" %3$s>%1$s</a>',
[762] Fix | Delete
$raw_value,
[763] Fix | Delete
esc_url( $url ),
[764] Fix | Delete
et_core_intentionally_unescaped( $link_target, 'fixed_string' )
[765] Fix | Delete
);
[766] Fix | Delete
}
[767] Fix | Delete
}
[768] Fix | Delete
}
[769] Fix | Delete
[770] Fix | Delete
return $raw_value;
[771] Fix | Delete
}
[772] Fix | Delete
}
[773] Fix | Delete
[774] Fix | Delete
new ET_Builder_Module_Testimonial();
[775] Fix | Delete
[776] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function