: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'lower-greek' => 'lower-greek',
'lower-latin' => 'lower-latin',
'lower-roman' => 'lower-roman',
'upper-alpha' => 'upper-alpha',
'upper-greek' => 'upper-greek',
'upper-latin' => 'upper-latin',
'upper-roman' => 'upper-roman',
'default_on_front' => '',
'tab_slug' => 'advanced',
'toggle_slug' => $option_name,
'mobile_options' => true,
$additional_options["{$option_name}_ol_position"] = array(
'label' => esc_html__( 'Ordered List Style Position', 'et_builder' ),
'description' => esc_html__( 'The characters that begins each list item can be placed either inside or outside the parent list wrapper. Placing list items inside will indent them further within the list.', 'et_builder' ),
'option_category' => 'configuration',
'inside' => et_builder_i18n( 'Inside' ),
'outside' => et_builder_i18n( 'Outside' ),
'default_on_front' => '',
'tab_slug' => 'advanced',
'toggle_slug' => $option_name,
'mobile_options' => true,
$additional_options["{$option_name}_ol_item_indent"] = array(
'label' => esc_html__( 'Ordered List Item Indent', 'et_builder' ),
'description' => esc_html__( 'Increasing indentation will push list items further towards the center of the text content, giving the list more visible separation from the the rest of the text.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'toggle_slug' => $option_name,
'allowed_units' => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'default_on_front' => '',
'range_settings' => array(
'mobile_options' => true,
// c. Quote - Border Weight and Border Color.
$additional_options["{$option_name}_quote_border_weight"] = array(
'label' => esc_html__( 'Blockquote Border Weight', 'et_builder' ),
'description' => esc_html__( 'Block quotes are given a border to separate them from normal text. You can increase or decrease the size of that border using this setting.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'toggle_slug' => $option_name,
'allowed_units' => array( 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
'default_on_front' => '',
'range_settings' => array(
'mobile_options' => true,
$additional_options["{$option_name}_quote_border_color"] = array(
'label' => esc_html__( 'Blockquote Border Color', 'et_builder' ),
'description' => esc_html__( 'Block quotes are given a border to separate them from normal text. Pick a color to use for that border.', 'et_builder' ),
'option_category' => 'configuration',
'tab_slug' => 'advanced',
'toggle_slug' => $option_name,
'field_template' => 'color',
'mobile_options' => true,
// Set default on child font settings.
if ( ! empty( $option_settings['fields_default_on_child'] ) ) {
$additional_options["{$option_name}_ul_type"]['default_on_child'] = true;
$additional_options["{$option_name}_ul_position"]['default_on_child'] = true;
$additional_options["{$option_name}_ul_item_indent"]['default_on_child'] = true;
$additional_options["{$option_name}_ol_type"]['default_on_child'] = true;
$additional_options["{$option_name}_ol_position"]['default_on_child'] = true;
$additional_options["{$option_name}_ol_item_indent"]['default_on_child'] = true;
$additional_options["{$option_name}_quote_border_weight"]['default_on_child'] = true;
$additional_options["{$option_name}_quote_border_color"]['default_on_child'] = true;
$this->_additional_fields_options = array_merge( $this->_additional_fields_options, $additional_options );
* Add background option fields.
* @since 3.23 Add responsive settings for background settings.
protected function _add_background_fields() {
// Background fields are added by default if module has partial or full VB support
if ( $this->has_vb_support() ) {
$this->advanced_fields['background'] = self::$_->array_get( $this->advanced_fields, 'background', array() );
} else if ( ! $this->has_advanced_fields ) {
// Disable if module doesn't set advanced_fields property and has no VB support
// Background settings have to be array
if ( ! is_array( self::$_->array_get( $this->advanced_fields, 'background' ) ) ) {
$toggle_disabled = self::$_->array_get( $this->advanced_fields, 'background.settings.disable_toggle', false );
$tab_slug = self::$_->array_get( $this->advanced_fields, 'background.settings.tab_slug', 'general' );
if ( ! $toggle_disabled ) {
$toggle_slug = self::$_->array_get( $this->advanced_fields, 'background.settings.toggle_slug', 'background' );
$background_toggle = array(
'title' => et_builder_i18n( 'Background' ),
$this->_add_settings_modal_toggles( $tab_slug, $background_toggle );
$background_field_name = "background";
// Possible values for use_* attributes: true, false, or 'fields_only'
'has_background_color_toggle' => false,
'use_background_color' => true,
'use_background_color_gradient' => true,
'use_background_image' => true,
'use_background_video' => true,
'use_background_color_reset' => true,
$this->advanced_fields['background'] = wp_parse_args( $this->advanced_fields['background'], $defaults );
$additional_options = array();
if ( $this->advanced_fields['background']['use_background_color'] ) {
$additional_options = array_merge(
$this->generate_background_options( 'background', 'color', $tab_slug, $toggle_slug, null )
// Use background color toggle was added on pre color-alpha era. Added for backward
// compatibility. This option's output is printed manually on render()
if ( $this->advanced_fields['background']['has_background_color_toggle'] ) {
$additional_options['use_background_color'] = array(
'label' => esc_html__( 'Use Background Color', 'et_builder' ),
'type' => 'yes_no_button',
'option_category' => 'color_option',
'on' => et_builder_i18n( 'Yes' ),
'off' => et_builder_i18n( 'No' ),
'toggle_slug' => $toggle_slug,
'description' => esc_html__( 'Here you can choose whether background color setting above should be used or not.', 'et_builder' ),
'mobile_options' => true,
if ( $this->advanced_fields['background']['use_background_color_gradient'] ) {
$additional_options = array_merge(
$this->generate_background_options( 'background', 'gradient', $tab_slug, $toggle_slug, null )
if ( $this->advanced_fields['background']['use_background_image'] ) {
$additional_options = array_merge(
$this->generate_background_options( 'background', 'image', $tab_slug, $toggle_slug, null )
if ( $this->advanced_fields['background']['use_background_video'] ) {
$additional_options = array_merge(
$this->generate_background_options( 'background', 'video', $tab_slug, $toggle_slug, null )
// Allow module to configure specific options
$background_options = self::$_->array_get( $this->advanced_fields, 'background.options', false );
if ( $background_options ) {
foreach ( $background_options as $option_slug => $options ) {
if ( ! is_array( $options ) ) {
foreach ( $options as $option_name => $option_value ) {
$additional_options[ $option_slug ][ $option_name ] = $option_value;
$this->_additional_fields_options = array_merge( $this->_additional_fields_options, $additional_options );
* Add text option fields.
* @since 3.23 Add responsive settings for text orientation and layout settings.
protected function _add_text_fields() {
// Text fields are added by default if module has partial or full VB support
if ( $this->has_vb_support() ) {
$this->advanced_fields['text'] = self::$_->array_get( $this->advanced_fields, 'text', array() );
} else if ( ! $this->has_advanced_fields ) {
// Disable if module doesn't set advanced_fields property and has no VB support
// Text settings have to be array
if ( ! is_array( self::$_->array_get( $this->advanced_fields, 'text' ) ) ) {
$text_settings = $this->advanced_fields['text'];
$tab_slug = isset( $text_settings['tab_slug'] ) ? $text_settings['tab_slug'] : 'advanced';
$toggle_slug = isset( $text_settings['toggle_slug'] ) ? $text_settings['toggle_slug'] : 'text';
$sub_toggle = isset( $text_settings['sub_toggle'] ) ? $text_settings['sub_toggle'] : '';
$orientation_exclude_options = isset( $text_settings['text_orientation'] ) && isset( $text_settings['text_orientation']['exclude_options'] ) ? $text_settings['text_orientation']['exclude_options'] : array();
// Make sure we can exclude text_orientation from Advanced/Text
$setting_defaults = array(
'use_text_orientation' => true,
'use_background_layout' => false,
$text_settings = wp_parse_args( $text_settings, $setting_defaults );
$this->_add_settings_modal_toggles( $tab_slug, array(
'title' => et_builder_i18n( 'Text' ),
$additional_options = array();
if ( $text_settings['use_text_orientation'] ) {
$default_on_front = self::$_->array_get( $text_settings, 'options.text_orientation.default_on_front', '' );
$additional_options = array(
'text_orientation' => wp_parse_args( self::$_->array_get( $text_settings, 'options.text_orientation', array()), array(
'label' => esc_html__( 'Text Alignment', 'et_builder' ),
'option_category' => 'layout',
'options' => et_builder_get_text_orientation_options( $orientation_exclude_options ),
'toggle_slug' => $toggle_slug,
'description' => esc_html__( 'This controls how your text is aligned within the module.', 'et_builder' ),
'advanced_fields' => true,
'default' => self::$_->array_get( $text_settings, 'options.text_orientation.default', $default_on_front ),
'mobile_options' => true,
if ( '' !== $sub_toggle ) {
$additional_options['text_orientation']['sub_toggle'] = $sub_toggle;
// Background layout works by setting text to light/dark color. This was added before text
// color has its own colorpicker as a simple mechanism for picking color.
// New module should not use this option. This is kept for backward compatibility
if ( $text_settings['use_background_layout'] ) {
$additional_options['background_layout'] = array(
'label' => esc_html__( 'Text Color', 'et_builder' ),
'option_category' => 'color_option',
'dark' => et_builder_i18n( 'Light' ),
'light' => et_builder_i18n( 'Dark' ),
'toggle_slug' => $toggle_slug,
'description' => esc_html__( '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' ),
'mobile_options' => true,
if ( '' !== $sub_toggle ) {
$additional_options['background_layout']['sub_toggle'] = $sub_toggle;
// Allow module to configure specific options
if ( isset( $text_settings['options'] ) && is_array( $text_settings['options'] ) ) {
foreach ( $text_settings['options'] as $option_slug => $options ) {
if ( ! is_array( $options ) ) {
foreach ( $options as $option_name => $option_value ) {
if ( isset( $additional_options[ $option_slug ] ) ) {
$additional_options[ $option_slug ][ $option_name ] = $option_value;
$this->_additional_fields_options = array_merge( $this->_additional_fields_options, $additional_options );
* Add Border & Border Radius fields to each module. Default borders option are added on with
* Borders fields group on Design tab. However, module can add more borders field by adding
* more settings on $this->advanced_fields['borders']
* border options are initially defined via _add_additional_border_fields() method and adding
* more border options require overwriting it on module's class. This is repetitive so
* the fields registration mechanics were simplified mimicing advanced fonts field mechanism.}
protected function _add_borders_fields() {
// Disable if module doesn't set advanced_fields property and has no VB support
if ( ! $this->has_vb_support() && ! $this->has_advanced_fields ) {
// Get borders settings. Fallback to default if needed. Borders are added to all modules by default
// unless the module explicitly disabled it
// Backward compatibility. Use `border` settings as default if exist
$legacy_border = self::$_->array_get( $this->advanced_fields, 'border', array() );
$borders_fields = self::$_->array_get( $this->advanced_fields, 'borders', array(
'default' => $legacy_border,
// Borders settings have to be array
if ( ! is_array( $borders_fields ) ) {
if ( ! isset( $i18n['border'] ) ) {
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
'title' => esc_html__( 'Border', 'et_builder' ),
// Loop border settings, enable multiple border fields declaration in one place
foreach ( $borders_fields as $border_fields_name => $border_fields ) {
// Enable module to disable border options by setting it to false
if ( false === $border_fields ) {
// Make sure that border fields has minimum attribute required
$border_fields_defaults = array(
'tab_slug' => 'advanced',
'toggle_slug' => 'border',
$border_fields = wp_parse_args( $border_fields, $border_fields_defaults );
// Check for default border options
$is_default_border_options = 'default' === $border_fields_name;
if ( $is_default_border_options ) {
// Default border fields doesn't have toggle for itself, thus register new toggle
$this->_add_settings_modal_toggles( $border_fields['tab_slug'], array(
$border_fields['toggle_slug'] => array(
'title' => $i18n['border']['title'],
// Add suffix to border fields settings
$suffix = $is_default_border_options ? '' : "_{$border_fields_name}";
$border_fields['suffix'] = $suffix;
// Assign CSS setting to advanced options
if ( isset( $border_fields['css'] ) ) {
$this->advanced_fields["border{$suffix}"]['css'] = $border_fields['css'];
// Add border fields to advanced_fields. Each border fields (style + radii) has its own attribute
// registered on $this->advanced_fields
self::$_->array_set( $this->advanced_fields, "border{$suffix}", $border_fields );
$this->_additional_fields_options = array_merge(
$this->_additional_fields_options,
ET_Builder_Module_Fields_Factory::get( 'Border' )->get_fields( $border_fields )
// Add module defined fields that needs to be added after existing border options
if ( isset( $border_fields['fields_after'] ) ) {
$this->_additional_fields_options = array_merge(
$this->_additional_fields_options,
$border_fields['fields_after']
// Loop radii and styles and add fields to advanced_fields
foreach ( array( 'border_radii', 'border_styles' ) as $border_key ) {
$border_key_name = $border_key . $suffix;
if ( isset( $this->advanced_fields["border{$suffix}"][ $border_key_name ] ) ) {
// Backward compatibility. Properly handle existing 3rd party module that
// directly defines border via direct $this->advanced_fields["border{$suffix}"]
$this->advanced_fields["border{$suffix}"][ $border_key_name ] = array_merge(
$this->advanced_fields["border{$suffix}"][ $border_key_name ],
$this->_additional_fields_options[ $border_key_name ]
$message = "You're Doing It Wrong! You shouldn't define border settings in 'advanced_fields' directly. All the Border settings should be defined via provided API";
// Border used to rely on $this->advanced_fields complete configuration for
// rendering. Since option template update, border style rendering fetches
// border setting based on rebuilt fields on demand for performance reason.
if ( method_exists( $this, '_add_additional_border_fields' ) ) {
// Backwards compatibility should go after all the fields added to emulate behavior of old version
$this->_add_additional_border_fields();
$message = "You're Doing It Wrong! '_add_additional_border_fields' is deprecated. All the Border settings should be defined via provided API";
protected function _add_transforms_fields() {
if ( ! isset( $i18n['transforms'] ) ) {
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
$i18n['transforms'] = array(
'title' => esc_html__( 'Transform', 'et_builder' ),
$this->advanced_fields['transform'] = self::$_->array_get( $this->advanced_fields, 'transform', array() );
if ( false === $this->advanced_fields['transform'] ) {
// Transforms settings have to be array
if ( ! is_array( $this->advanced_fields['transform'] ) ) {
$this->settings_modal_toggles['advanced']['toggles']['transform'] = array(
'title' => $i18n['transforms']['title'],
$this->_additional_fields_options = array_merge(
$this->_additional_fields_options,
/** @see ET_Builder_Module_Field_Transform::get_fields() */
ET_Builder_Module_Fields_Factory::get( 'Transform' )->get_fields()
protected function _add_sizing_fields() {
// Maybe someone did overwrite this function
$this->_add_max_width_fields();