: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* WooCommerce Modules: ET_Builder_Module_Woocommerce_Title class
* The ET_Builder_Module_Woocommerce_Title Class is responsible for rendering the
* Title markup using the WooCommerce template.
* Class representing WooCommerce Title component.
class ET_Builder_Module_Woocommerce_Title extends ET_Builder_Module {
$this->name = esc_html__( 'Woo Title', 'et_builder' );
$this->plural = esc_html__( 'Woo Titles', 'et_builder' );
$this->slug = 'et_pb_wc_title';
$this->vb_support = 'on';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Content' ),
'title' => esc_html__( 'Title Text', 'et_builder' ),
'title' => et_builder_i18n( 'Sizing' ),
$this->advanced_fields = array(
'label' => et_builder_i18n( 'Title' ),
'main' => '%%order_class%% h1, %%order_class%% h2, %%order_class%% h3, %%order_class%% h4, %%order_class%% h5, %%order_class%% h6',
'tab_slug' => 'advanced',
'toggle_slug' => 'header',
'margin_padding' => array(
'use_background_layout' => true,
'use_text_orientation' => false,
'text_shadow' => '%%order_class%% .et_pb_wc_title',
'background_layout' => array(
'default_on_front' => 'light',
'toggle_slug' => 'header',
// Don't add text-shadow fields since they already are via font-options.
$this->custom_css_fields = array(
'label' => esc_html__( 'Title Text', 'et_builder' ),
'selector' => '%%order_class%% h1, %%order_class%% h2, %%order_class%% h3, %%order_class%% h4, %%order_class%% h5, %%order_class%% h6',
$this->help_videos = array(
'name' => esc_html__( 'Divi WooCommerce Modules', 'et_builder' ),
public function get_fields() {
'product' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
'default' => ET_Builder_Module_Helper_Woocommerce_Modules::get_product_default(),
'computed_affects' => array(
'product_filter' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
'computed_affects' => array(
'computed_callback' => array(
'ET_Builder_Module_Woocommerce_Title',
'computed_depends_on' => array(
'computed_minimum' => array(
* @param array $args Additional arguments.
public static function get_title( $args = array() ) {
if ( et_builder_tb_enabled() ) {
return esc_html( 'Product Name', 'et_builder' );
$args = wp_parse_args( $args, $defaults );
$title = et_builder_wc_render_module_template(
* Gets the WooCommerce Product Title markup.
protected function get_title_markup() {
$header_level = $this->props['header_level'];
$product_title = self::get_title( $this->props );
et_pb_process_header_level( $header_level, 'h1' ),
et_core_esc_previously( $product_title )
* Renders the module output.
* @param array $attrs List of attributes.
* @param string $content Content being processed.
* @param string $render_slug Slug of module that is used for rendering output.
public function render( $attrs, $content = null, $render_slug ) {
ET_Builder_Module_Helper_Woocommerce_Modules::process_background_layout_data( $render_slug, $this );
$this->add_classname( $this->get_text_orientation_classname() );
$output = self::get_title_markup();
// Render empty string if no output is generated to avoid unwanted vertical space.
return $this->_render_module_wrapper( $output, $render_slug );
new ET_Builder_Module_Woocommerce_Title();