: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* WooCommerce Modules: ET_Builder_Module_Woocommerce_Meta class
* The ET_Builder_Module_Woocommerce_Meta Class is responsible for rendering the
* Meta markup using the WooCommerce template.
* Class representing WooCommerce Meta component.
class ET_Builder_Module_Woocommerce_Meta extends ET_Builder_Module {
$this->name = esc_html__( 'Woo Meta', 'et_builder' );
$this->plural = esc_html__( 'Woo Metas', 'et_builder' );
$this->slug = 'et_pb_wc_meta';
$this->vb_support = 'on';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Content' ),
'elements' => et_builder_i18n( 'Elements' ),
'layout' => et_builder_i18n( 'Layout' ),
'title' => et_builder_i18n( 'Text' ),
'tabbed_subtoggles' => true,
'bb_icons_support' => true,
$this->advanced_fields = array(
'label' => esc_html__( 'Meta', 'et_builder' ),
'main' => '%%order_class%% .product_meta, %%order_class%% .product_meta a',
'label' => et_builder_i18n( 'Link' ),
'main' => '%%order_class%% div.product_meta a',
'hide_text_align' => true,
'main' => '%%order_class%% .product_meta',
'margin_padding' => array(
'main' => '%%order_class%% .product_meta',
'use_text_orientation' => false,
// Don't add text-shadow fields since they already are via font-options.
'main' => '%%order_class%% .product_meta',
'border_radii' => "%%order_class%% .product_meta",
'border_styles' => "%%order_class%% .product_meta",
'border_radii' => 'on||||',
'border_styles' => array(
'border_width_top' => '1px',
'border_color_top' => '#dadada',
'main' => '%%order_class%% .product_meta',
$this->custom_css_fields = array(
'label' => esc_html__( 'Meta Text', 'et_builder' ),
'selector' => '.product_meta, .product_meta a',
$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(
'label' => esc_html__( 'Separator', 'et_builder' ),
'option_category' => 'basic_option',
'description' => esc_html__( 'Here you can set the separator.', 'et_builder' ),
'toggle_slug' => 'main_content',
'meta_layout' => 'inline',
'label' => esc_html__( 'Show SKU', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'on' => et_builder_i18n( 'On' ),
'off' => et_builder_i18n( 'Off' ),
'default_on_front' => 'on',
'toggle_slug' => 'elements',
'description' => esc_html__( 'Here you can choose whether the SKU should be added.', 'et_builder' ),
'mobile_options' => true,
'show_categories' => array(
'label' => esc_html__( 'Show Categories', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'on' => et_builder_i18n( 'On' ),
'off' => et_builder_i18n( 'Off' ),
'default_on_front' => 'on',
'toggle_slug' => 'elements',
'description' => esc_html__( 'Here you can choose whether the Categories should be added.', 'et_builder' ),
'mobile_options' => true,
'label' => esc_html__( 'Show Tags', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'configuration',
'on' => et_builder_i18n( 'On' ),
'off' => et_builder_i18n( 'Off' ),
'default_on_front' => 'on',
'toggle_slug' => 'elements',
'description' => esc_html__( 'Here you can choose whether the Tags should be added.', 'et_builder' ),
'mobile_options' => true,
'label' => esc_html__( 'Meta Layout', 'et_builder' ),
'option_category' => 'layout',
'inline' => esc_html__( 'Inline', 'et_builder' ),
'stacked' => esc_html__( 'Stacked', 'et_builder' ),
'tab_slug' => 'advanced',
'toggle_slug' => 'layout',
'description' => esc_html__( 'Here you can choose how to position the product meta.', 'et_builder' ),
'default_on_front' => 'inline',
'computed_callback' => array(
'ET_Builder_Module_Woocommerce_Meta',
'computed_depends_on' => array(
'computed_minimum' => array(
* @param array $args Additional arguments.
public static function get_meta( $args = array() ) {
$args = wp_parse_args( $args, $defaults );
$meta = et_builder_wc_render_module_template(
'woocommerce_template_single_meta',
* Adds Multi view attributes to the Outer wrapper.
* Since we do not have control over the WooCommerce Breadcrumb markup, we inject Multi view
* attributes on to the Outer wrapper.
* @param array $outer_wrapper_attrs
* @param ET_Builder_Module_Woocommerce_Meta $this_class
public function add_multi_view_attrs( $outer_wrapper_attrs, $this_class ) {
$multi_view = et_pb_multi_view_options( $this_class );
$multi_view_attrs = $multi_view->render_attrs( array(
'et_pb_wc_no_sku' => array(
'et_pb_wc_no_categories' => array(
'show_categories' => 'off',
'et_pb_wc_no_tags' => array(
if ( $multi_view_attrs && is_array( $multi_view_attrs ) ) {
$outer_wrapper_attrs = array_merge( $outer_wrapper_attrs, $multi_view_attrs );
return $outer_wrapper_attrs;
* 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 ) {
$multi_view = et_pb_multi_view_options( $this );
ET_Builder_Module_Helper_Woocommerce_Modules::process_background_layout_data( $render_slug, $this );
$this->add_classname( $this->get_text_orientation_classname() );
if ( 'on' !== $multi_view->get_value( 'show_sku' ) ) {
$this->add_classname( 'et_pb_wc_no_sku' );
if ( 'on' !== $multi_view->get_value( 'show_categories' ) ) {
$this->add_classname( 'et_pb_wc_no_categories' );
if ( 'on' !== $multi_view->get_value( 'show_tags' ) ) {
$this->add_classname( 'et_pb_wc_no_tags' );
$this->add_classname( esc_attr( 'et_pb_wc_meta_layout_' . $this->props['meta_layout'] ) );
* Append separator via css pseudo selector so meta module can reuse default WooCommerce
* template (default WooCommerce meta template has no separator option)
ET_Builder_Element::set_style(
'%%order_class%%:not(.et_pb_wc_no_categories).et_pb_wc_meta_layout_inline .sku_wrapper:after',
'%%order_class%%:not(.et_pb_wc_no_tags).et_pb_wc_meta_layout_inline .sku_wrapper:after',
'%%order_class%%:not(.et_pb_wc_no_tags).et_pb_wc_meta_layout_inline .posted_in:after',
'declaration' => 'content: " ' . esc_html(
ET_Builder_Module_Helper_Woocommerce_Modules::escape_special_chars(
$this->props['separator'] ) ) . ' "',
add_filter( "et_builder_module_{$render_slug}_outer_wrapper_attrs", array(
$output = self::get_meta( $this->props );
// 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_Meta();