: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! isset( $tabs_output_processed[ $tab_slug ][ $toggle_slug ] ) ) {
$is_accordion_enabled = isset( $this->settings_modal_toggles[ $tab_slug ]['settings']['bb_toggles_enabeld'] ) && $this->settings_modal_toggles[ $tab_slug ]['settings']['bb_toggles_enabled'] ? true : false;
$is_tabbed_subtoggles = isset( $toggle_data['tabbed_subtoggles'] );
$is_bb_icons_support = isset( $toggle_data['bb_icons_support'] );
$subtoggle_tabs_nav = '';
if ( is_array( $toggle_data ) && ! empty( $toggle_data ) ) {
if ( ! isset( $toggle_data['sub_toggles'] ) ) {
$toggle_data['sub_toggles'] = array( 'main' => '' );
foreach( $toggle_data['sub_toggles'] as $sub_toggle_id => $sub_toggle_data ) {
if ( ! isset( $tabs_output_processed[ $tab_slug ][ $toggle_slug ][ $sub_toggle_id ] ) ) {
if ( $is_tabbed_subtoggles ) {
$subtoggle_tabs_nav .= sprintf(
'<li class="subtoggle_tabs_nav_item"><a class="subtoggle_tabs_nav_item_inner%3$s" data-tab_id="%1$s">%2$s</a></li>',
$is_bb_icons_support ? '' : esc_html( $sub_toggle_data['name'] ),
$is_bb_icons_support ? sprintf( ' subtoggle_tabs_nav_icon subtoggle_tabs_nav_icon-%1$s', esc_attr( $sub_toggle_data['icon'] ) ) : ''
foreach ( $tabs_output_processed[ $tab_slug ][ $toggle_slug ][ $sub_toggle_id ] as $toggle_option_output ) {
$subtoggle_options .= $toggle_option_output;
if ( 'main' === $sub_toggle_id ) {
$toggle_output .= $subtoggle_options;
$toggle_output .= sprintf(
'<div class="et_pb_subtoggle_section%2$s"%3$s>
$is_tabbed_subtoggles ? ' et_pb_tabbed_subtoggle' : '',
$is_tabbed_subtoggles ? sprintf( ' data-tab_id="%1$s"', esc_attr( $sub_toggle_id ) ) : ''
foreach ( $tabs_output_processed[ $tab_slug ][ $toggle_slug ] as $toggle_option_id => $toggle_option_data ) {
foreach( $toggle_option_data as $toggle_option_output ) {
$toggle_output .= $toggle_option_output;
if ( '' === $toggle_output ) {
$toggle_output = sprintf(
'<div class="et-pb-options-toggle-container%3$s%4$s%5$s">
<h3 class="et-pb-option-toggle-title">%1$s</h3>
<div class="et-pb-option-toggle-content">
esc_html( $toggle_heading ),
( $is_accordion_enabled ? ' et-pb-options-toggle-enabled' : ' et-pb-options-toggle-disabled' ),
( 1 === $i && $is_accordion_enabled ? ' et-pb-option-toggle-content-open' : '' ),
$is_tabbed_subtoggles ? ' et_pb_contains_tabbed_subtoggle' : '',
$is_tabbed_subtoggles && '' !== $subtoggle_tabs_nav ? sprintf( '<ul class="subtoggle_tabs_nav">%1$s</ul>', $subtoggle_tabs_nav ) : ''
$tab_output .= $toggle_output;
'<div class="et-pb-options-tab et-pb-options-tab-%1$s">
( 'general' === $tab_slug ? $this->children_settings() : '' )
// return error message if no tabs allowed for current user
$output = esc_html__( "You don't have sufficient permissions to access the settings", 'et_builder' );
function children_settings() {
if ( ! empty( $this->child_slug ) ) {
$child_module = self::get_module( $this->child_slug );
if ( isset( $child_module->bb_support ) && ! $child_module->bb_support ) {
'%6$s<div class="et-pb-option-advanced-module-settings" data-module_type="%1$s">
<ul class="et-pb-sortable-options">
<div class="et-pb-option et-pb-option-main-content et-pb-option-advanced-module">
<label for="et_pb_content">%3$s</label>
<div class="et-pb-option-container">
<div id="et_pb_content"><%%= typeof( et_pb_content )!== \'undefined\' && \'\' !== et_pb_content.trim() ? et_pb_content : \'%7$s\' %%></div>
<p class="description">%4$s</p>
esc_attr( $this->child_slug ),
! in_array( $this->child_slug, array( 'et_pb_column', 'et_pb_column_inner' ) ) ? sprintf( '<a href="#" class="et-pb-add-sortable-option"><span>%1$s</span></a>', esc_html( $this->add_new_child_text() ) ) : '',
et_builder_i18n( 'Content' ),
esc_html__( 'Here you can define the content that will be placed within the current tab.', 'et_builder' ),
$this->predefined_child_modules()
function add_new_child_text() {
$child_slug = ! empty( $this->child_item_text ) ? $this->child_item_text : '';
$child_slug = '' === $child_slug ? esc_html__( 'Add New Item', 'et_builder' ) : sprintf( esc_html__( 'Add New %s', 'et_builder' ), $child_slug );
function wrap_settings( $output ) {
// General Settings Tab should be added to all modules if allowed
if ( et_pb_is_allowed( 'general_settings' ) ) {
$tabs['general'] = isset( $this->main_tabs['general'] ) ? $this->main_tabs['general'] : esc_html__( 'General Settings', 'et_builder' );
foreach ( $this->used_tabs as $tab_slug ) {
if ( 'general' === $tab_slug ) {
// Add only tabs allowed for current user
if ( et_pb_is_allowed( $tab_slug . '_settings' ) ) {
if ( isset( $this->main_tabs[ $tab_slug ] ) ) {
// if it's one of 3 default tabs
$tabs[ $tab_slug ] = $this->main_tabs[ $tab_slug ];
// Use tab name if it's properly registered custom tab. Fallback to tab slug otherwise
$tabs[ $tab_slug ] = isset( $this->settings_modal_tabs ) && isset( $this->settings_modal_tabs[ $tab_slug ] ) ? $this->settings_modal_tabs[ $tab_slug ]['name'] : $tab_slug;
foreach ( $tabs as $tab_slug => $tab_name ) {
$tabs_json = wp_json_encode( $tabs_array );
$tabs_output = sprintf( '<%%= window.et_builder.settings_tabs_output(%1$s) %%>', $tabs_json );
$preview_tabs_output = '<%= window.et_builder.preview_tabs_output() %>';
<div class="et-pb-options-tabs">
<div class="et-pb-preview-tab"></div>
'%2$s<div class="et-pb-main-settings">%1$s</div>%3$s',
function wrap_validation_form( $output ) {
return '<form class="et-builder-main-settings-form validate">' . $output . '</form>';
* Get the module's props mapped to their default values.
* @since 3.1 Renamed from `get_shortcode_fields()` to `get_default_props()`.
public function get_default_props() {
if ( method_exists( $this, 'get_shortcode_fields' ) ) {
// Backwards compatibility
return $this->__call( 'get_shortcode_fields', array() );
// Get module's default props from static property If current module's default props
// have been generated before.
if ( isset( self::$_default_props[ $this->slug ] ) ) {
return self::$_default_props[ $this->slug ];
// Resolve option template
foreach( $this->process_fields( $this->fields_unprocessed ) as $field_name => $field ) {
if ( isset( $field['composite_type'], $field['composite_structure'] ) ) {
require_once ET_BUILDER_DIR . 'module/field/attribute/composite/Parser.php';
$composite_atts = ET_Builder_Module_Field_Attribute_Composite_Parser::parse( $field['composite_type'], $field['composite_structure'] );
$fields = array_merge( $fields, $composite_atts );
if ( isset( $field['default_on_front'] ) ) {
$value = $field['default_on_front'];
} else if ( isset( $field['default'] ) ) {
$value = $field['default'];
$fields[ $field_name ] = $value;
$fields['disabled'] = 'off';
$fields['disabled_on'] = '';
$fields['global_module'] = '';
$fields['temp_global_module'] = '';
$fields['global_parent'] = '';
$fields['temp_global_parent'] = '';
$fields['saved_tabs'] = '';
$fields['ab_subject'] = '';
$fields['ab_subject_id'] = '';
$fields['template_type'] = '';
$fields['inline_fonts'] = '';
$fields['collapsed'] = '';
// Default props of each modules are always identical; thus saves it as static prop
// so the next same modules doesn't need to process all of these again repetitively.
self::$_default_props[ $this->slug ] = $fields;
function get_module_data_attributes() {
$attributes = apply_filters(
"{$this->slug}_data_attributes",
if ( ! empty( $attributes ) ) {
foreach ( $attributes as $name => $value ) {
$data_attributes .= sprintf(
function build_microtemplate() {
$this->validation_in_use = false;
if ( 'child' === $this->type ) {
$id_attr = sprintf( 'et-builder-advanced-setting-%s', $this->slug );
$id_attr = sprintf( 'et-builder-%s-module-template', $this->slug );
if ( ! isset( $this->settings_text ) ) {
$settings_text = sprintf(
__( '%1$s %2$s Settings', 'et_builder' ),
'child' === $this->type ? esc_html__( 'Item', 'et_builder' ) : esc_html__( 'Module', 'et_builder' )
$settings_text = $this->settings_text;
if ( file_exists( ET_BUILDER_DIR . 'microtemplates/' . $this->slug . '.php' ) ) {
include ET_BUILDER_DIR . 'microtemplates/' . $this->slug . '.php';
$output = ob_get_clean();
$output = $this->get_options();
$output = $this->wrap_settings( $output );
if ( $this->validation_in_use ) {
$output = $this->wrap_validation_form( $output );
$template_output = sprintf(
'<script type="text/template" id="%1$s">
<h3 class="et-pb-settings-heading">%2$s</h3>
esc_html( $settings_text ),
et_core_intentionally_unescaped( $output, 'html' )
if ( 'child' === $this->type ) {
$title_var = esc_js( $this->child_title_var );
$title_var = false === strpos( $title_var, 'et_pb_' ) && 'admin_label' !== $title_var ? 'et_pb_' . $title_var : $title_var;
$title_fallback_var = esc_js( $this->child_title_fallback_var );
$title_fallback_var = false === strpos( $title_fallback_var, 'et_pb_' ) ? 'et_pb_'. $title_fallback_var : $title_fallback_var;
$add_new_text = isset( $this->advanced_setting_title_text ) ? $this->advanced_setting_title_text : $this->add_new_child_text();
$template_output .= sprintf(
'%6$s<script type="text/template" id="et-builder-advanced-setting-%1$s-title">
<%% if ( typeof( %2$s ) !== \'undefined\' && typeof( %2$s ) === \'string\' && %2$s !== \'\' ) { %%>
<%% if ( ET_PageBuilder.isDynamicContent(%2$s) ) { %%>
<%%- %2$s.replace( /%%91/g, "[" ).replace( /%%93/g, "]" ) %%>
<%% } else if ( typeof( %3$s ) !== \'undefined\' && typeof( %3$s ) === \'string\' && %3$s !== \'\' ) { %%>
<%% if ( ET_PageBuilder.isDynamicContent(%3$s) ) { %%>
<%%- %3$s.replace( /%%91/g, "[" ).replace( /%%93/g, "]" ) %%>
esc_html( $title_fallback_var ),
esc_html( $add_new_text ),
$this->get_icon( 'lock' ) . esc_html__( 'Dynamic Content', 'et_builder' )
function get_gradient( $args ) {
$defaults = apply_filters( 'et_pb_default_gradient', array(
'type' => ET_Global_Settings::get_value( 'all_background_gradient_type' ),
'direction' => ET_Global_Settings::get_value( 'all_background_gradient_direction' ),
'radial_direction' => ET_Global_Settings::get_value( 'all_background_gradient_direction_radial' ),
'color_start' => ET_Global_Settings::get_value( 'all_background_gradient_start' ),
'color_end' => ET_Global_Settings::get_value( 'all_background_gradient_end' ),
'start_position' => ET_Global_Settings::get_value( 'all_background_gradient_start_position' ),
'end_position' => ET_Global_Settings::get_value( 'all_background_gradient_end_position' ),
$args = wp_parse_args( array_filter( $args ), $defaults );
$direction = $args['type'] === 'linear' ? $args['direction'] : "circle at {$args['radial_direction']}";
$start_position = et_sanitize_input_unit( $args['start_position'], false, '%' );
$end_Position = et_sanitize_input_unit( $args['end_position'], false, '%');
return esc_html( "{$args['type']}-gradient(
{$args['color_start']} ${start_position},
{$args['color_end']} ${end_Position}
function get_rel_values() {
function get_rel_attributes( $saved_value, $add_tag = true ) {
$rel_attributes = array();
$rel_values = $this->get_rel_values();
$selected_rels = explode( '|', $saved_value );
foreach ( $selected_rels as $index => $selected_rel ) {
if ( ! $selected_rel || 'off' === $selected_rel ) {
$rel_attributes[] = $rel_values[ $index ];
$attr = empty( $rel_attributes ) ? '' : implode( ' ', $rel_attributes );
return ( $add_tag && '' !== $attr ) ? sprintf( ' rel="%1$s"', esc_attr( $attr ) ) : $attr;
* @since 3.23 Add device and desktop default parameter to get responsive value.
* @param string $device Device name.
* @param string $desktop_default Default desktop value.
* @return string RTL ready text alignment value.
function get_text_orientation( $device = 'desktop', $desktop_default = '' ) {
$text_orientation = 'desktop' === $device && isset( $this->props['text_orientation'] ) ? $this->props['text_orientation'] : '';
if ( 'desktop' !== $device ) {
$text_orientation = et_pb_responsive_options()->get_any_value( $this->props, "text_orientation_{$device}", $desktop_default );
return et_pb_get_alignment( $text_orientation );
* Get text orientation class.
* @since 3.23 Generate text orientation classes for tablet and phone.
* @return string Text orientation class names.
function get_text_orientation_classname( $print_default = false ) {
$text_orientation = $this->get_text_orientation();
$text_orientation_tablet = $this->get_text_orientation( 'tablet' );
$text_orientation_phone = $this->get_text_orientation( 'phone' );
// Should be `justified` instead of justify in classname.
$text_orientation = 'justify' === $text_orientation ? 'justified' : $text_orientation;
$text_orientation_tablet = 'justify' === $text_orientation_tablet ? 'justified' : $text_orientation_tablet;
$text_orientation_phone = 'justify' === $text_orientation_phone ? 'justified' : $text_orientation_phone;
$default_classname = $print_default ? ' et_pb_text_align_left' : '';
$text_orientation_classname = '';
if ( '' !== $text_orientation ) {
$text_orientation_classname .= " et_pb_text_align_{$text_orientation}";
if ( '' !== $text_orientation_tablet ) {
$text_orientation_classname .= " et_pb_text_align_{$text_orientation_tablet}-tablet";
if ( '' !== $text_orientation_phone ) {
$text_orientation_classname .= " et_pb_text_align_{$text_orientation_phone}-phone";
return '' !== $text_orientation_classname ? $text_orientation_classname : $default_classname;
// intended to be overridden as needed
function get_max_width_additional_css() {
public function get_type() {