: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( false === $post_type ) {
if ( is_a( $post, 'WP_POST' ) ) {
$post_type = $post->post_type;
} else if ( $ajax_use_cache ) {
$post_type = et_()->array_get( $_POST, 'et_post_type', 'page' );
} else if ( is_admin() && ! wp_doing_ajax() ) {
$et_builder_post_type = $post_type = 'page';
if ( false === $post_type ) {
$post_type = apply_filters( 'et_builder_cache_post_type', $post_type, 'modules' );
$post_type = trim( sanitize_file_name( $post_type ), '.' );
// Per language Cache due to fields data being localized.
// Use user custom locale only if admin or VB/BFB
$lang = is_admin() || et_fb_is_enabled() ? get_user_locale() : get_locale();
$lang = trim( sanitize_file_name( $lang ), '.' );
$cache = sprintf( '%s/%s', ET_Core_PageResource::get_cache_directory(), $lang );
$files = glob( sprintf( '%s/%s-%s-*.data', $cache, $prefix, $post_type ) );
$exists = is_array( $files ) && $files;
} elseif ( $ajax_use_cache ) {
// Allowlisted AJAX requests aren't allowed to generate cache, only to use it.
$uniq = str_replace( '.', '', (string) microtime( true ) );
$file = sprintf( '%s/%s-%s-%s.data', $cache, $prefix, $post_type, $uniq );
return wp_is_writable( dirname( $file ) ) ? $file : false;
* Get Module cache file name's id.
* @param mixed $post_type When set to `false`, autodetect.
public static function get_cache_filename_id( $post_type = false ) {
$filename = self::get_cache_filename( $post_type );
if ( ! is_string( $filename ) ) {
preg_match( '/(?<=-)[0-9]*(?=.data)/', $filename, $matches );
return isset( $matches[0] ) ? $matches[0] : false;
public static function save_cache() {
remove_filter( 'et_builder_modules_is_saving_cache', '__return_true' );
$cache = self::get_cache_filename();
et_()->WPFS()->put_contents( $cache, serialize( array(
self::$_fields_unprocessed,
self::$option_template->all(),
self::$option_template->templates(),
self::$option_template->get_tab_slug_map(),
* Render image element HTML
* @param string $image_props Image data props key or actual image URL.
* @param array $image_attrs_raw List of extra image attributes.
* @param array $echo Wheter to print the image output or return it.
* @param array $disable_responsive Wheter to enable the responsive image or not.
* @return string The images's HTML output. Empty string on failure.
protected function render_image( $image_props, $image_attrs_raw = array(), $echo = true, $disable_responsive = false ) {
// Bail early when the $image_props arg passed is empty.
$img_src = $image_props && is_string( $image_props ) ? self::$_->array_get( $this->props, $image_props, $image_props ) : $image_props;
if ( ! count( $image_attrs_raw ) ) {
return et_image_add_srcset_and_sizes( $html, $echo );
$is_disable_responsive = $disable_responsive || ! et_is_responsive_images_enabled();
foreach ( $image_attrs_raw as $name => $value ) {
// Skip src attributes key.
// Skip srcset & sizes attributes when setting is off.
if ( $is_disable_responsive && in_array( $name, array( 'srcset', 'sizes' ), true ) ) {
// Skip if attributes value is empty.
if ( ! strlen( $value ) ) {
// Format as JSON if the value is array or object.
if ( is_array( $value ) || is_object( $value ) ) {
$value = wp_json_encode( $value );
// Trim extra space from attributes value.
// Standalone attributes that act as Booleans (Numerical indexed array keys such as required, disabled, multiple).
if ( is_numeric( $name ) ) {
$value = et_core_esc_attr( $value, $value );
if ( ! is_wp_error( $value ) ) {
$image_attrs[ $value ] = et_core_esc_previously( $value );
$value = et_core_esc_attr( $name, $value );
if ( ! is_wp_error( $value ) ) {
$image_attrs[ $name ] = esc_attr( $name ) . '="' . et_core_esc_previously( $value ) . '"';
'<img src="%1$s" %2$s />',
et_core_esc_previously( implode( ' ', $image_attrs ) )
if ( ! $is_disable_responsive && ! isset( $image_attrs['srcset'] ) && ! isset( $image_attrs['sizes'] ) ) {
$html = et_image_add_srcset_and_sizes( $html, false );
echo et_core_intentionally_unescaped( $html, 'html' );
* Get advanced field settings exposed for layout block preview
public static function get_layout_block_assistive_settings() {
return self::$layout_block_assistive_settings;
public static function enqueue_scroll_effects_fields() {
apply_filters( 'et_builder_modules_script_handle', 'et-builder-modules-script' ),
ET_Builder_Element::$_scroll_effects_fields
* Get whether the provided element content contains at least one of the
* specified modules based on their slugs.
* @param string[] $module_slugs
protected static function contains( $content, $module_slugs ) {
foreach ( $module_slugs as $slug ) {
if ( false !== strpos( $content, '[' . $slug ) ) {
/* ================================================================================================================
* -------------------------->>> Class-level (static) deprecations begin here! <<<---------------------------------
* ================================================================================================================ */
* @deprecated See {@see self::get_parent_slugs_regex()}
public static function get_parent_shortcodes( $post_type ) {
$replacement = __CLASS__ . '::get_parent_slugs_regex()';
et_error( "You're Doing It Wrong! {$method} is deprecated. Use {$replacement} instead." );
return self::get_parent_slugs_regex( $post_type );
* @deprecated See {@see self::get_child_slugs_regex()}
public static function get_child_shortcodes( $post_type ) {
$replacement = __CLASS__ . '::get_child_slugs_regex()';
et_error( "You're Doing It Wrong! {$method} is deprecated. Use {$replacement} instead." );
return self::get_child_slugs_regex( $post_type );
* @param string $post_type
public static function get_defaults( $post_type = '', $mode = 'all' ) {
et_error( "You're Doing It Wrong! " . __METHOD__ . ' is deprecated and should not be used.' );
* @param string $post_type
public static function get_fields_defaults( $post_type = '', $mode = 'all' ) {
et_error( "You're Doing It Wrong! " . __METHOD__ . ' is deprecated and should not be used.' );
public static function get_slugs_with_children( $post_type ) {
$parent_modules = self::get_parent_modules( $post_type );
foreach ( $parent_modules as $module ) {
if ( ! empty( $module->child_slug ) ) {
$slugs[] = sprintf( '"%1$s":"%2$s"', esc_js( $module->slug ), esc_js( $module->child_slug ) );
return '{' . implode( ',', $slugs ) . '}';
/* ================================================================================================================
* ------------------------------->>> Non-static deprecations begin here! <<<--------------------------------------
* ================================================================================================================ */
* Determine if current request is VB Data Request by checking $_POST['action'] value
* @deprecated {@see et_builder_is_loading_vb_data()}
* @since 4.0.7 Deprecated.
protected function is_loading_vb_data() {
return et_builder_is_loading_data();
* Determine if current request is BB Data Request by checking $_POST['action'] value
* @deprecated {@see et_builder_is_loading_bb_data()}
* @since 4.0.7 Deprecated.
protected function is_loading_bb_data() {
return et_builder_is_loading_data( 'bb' );
/* NOTE: Adding a new method? New methods should be placed BEFORE deprecated methods. */
do_action( 'et_pagebuilder_module_init' );
class ET_Builder_Module extends ET_Builder_Element {}
class ET_Builder_Structure_Element extends ET_Builder_Element {
public $is_structure_element = true;
function wrap_settings_option( $option_output, $field, $name = '' ) {
// Option template convert array field into string id; return early to prevent error
if ( is_string( $field ) ) {
$field_type = ! empty( $field['type'] ) ? $field['type'] : '';
case 'column_settings_background' :
$output = $this->generate_columns_settings_background();
$field['hover'] = 'tabs';
case 'column_settings_padding' :
$output = $this->generate_columns_settings_padding();
case 'column_settings_css_fields' :
$output = $this->generate_columns_settings_css_fields();
case 'column_settings_css' :
$output = $this->generate_columns_settings_css();
case 'column-structure' :
// column structure option is not supported in BB
$new_depends = isset( $field['show_if'] ) || isset( $field['show_if_not'] );
if ( ! $new_depends && ( isset( $field['depends_show_if'] ) || isset( $field['depends_show_if_not'] ) ) ) {
if ( isset( $field['depends_show_if_not'] ) ) {
$depends_show_if_not = is_array( $field['depends_show_if_not'] ) ? implode( ',', $field['depends_show_if_not'] ) : $field['depends_show_if_not'];
$depends_attr = sprintf( ' data-depends_show_if_not="%s"', esc_attr( $depends_show_if_not ) );
$depends_attr = sprintf( ' data-depends_show_if="%s"', esc_attr( $field['depends_show_if'] ) );
// Overriding background color's attribute, turning it into appropriate background attributes
if ( isset( $field['type'] ) && isset( $field['name' ] ) && in_array( $field['name'], array( 'background_color' ) ) ) {
$field['type'] = 'background';
// Appending background class
if ( isset( $field['option_class'] ) ) {
$field['option_class'] .= ' et-pb-option--background';
$field['option_class'] = 'et-pb-option--background';
// Removing depends default variable which hides background color for unified background field UI
if ( isset( $field['depends_show_if'] ) ) {
unset( $field['depends_show_if'] );
'%6$s<div class="et-pb-option et-pb-option--%11$s%1$s%2$s%3$s%8$s%9$s%10$s%13$s"%4$s data-option_name="%12$s">%5$s</div>%7$s',
( ! empty( $field['type'] ) && 'tiny_mce' === $field['type'] ? ' et-pb-option-main-content' : '' ),
$depends || $new_depends ? ' et-pb-depends' : '',
( ! empty( $field['type'] ) && 'hidden' === $field['type'] ? ' et_pb_hidden' : '' ),
( $depends ? $depends_attr : '' ),
"\n\t\t\t\t" . $option_output . "\n\t\t\t",
( ! empty( $field['type'] ) && 'hidden' === $field['type'] ? esc_attr( sprintf( ' et-pb-option-%1$s', $field['name'] ) ) : '' ),
( ! empty( $field['option_class'] ) ? ' ' . $field['option_class'] : '' ),
isset( $field['specialty_only'] ) && 'yes' === $field['specialty_only'] ? ' et-pb-specialty-only-option' : '',
isset( $field['type'] ) ? esc_attr( $field['type'] ) : '',
esc_attr( $field['name'] ),
$new_depends ? ' et-pb-new-depends' : ''
if ( ! empty( $field['hover'] ) ) {
if ( 'tabs' === $field['hover'] ) {
$name = ( 'columns_background' === $name ) ? 'background_color_<%= counter %>' : $name;
$this->last_hover_tab_field = $name;
$hover = $this->last_hover_tab_field;
$begin = '<div class="et-pb-option ';
$pos = strpos( $output, $begin );
$output = substr_replace(
"<div data-depends_hover=\"$hover\" class=\"et-pb-option-standard et-pb-option ",
return self::get_unique_bb_key( $output );
function generate_column_vars_css() {
for ( $i = 1; $i < 4; $i++ ) {
current_module_id_value = typeof et_pb_module_id_%1$s !== \'undefined\' ? et_pb_module_id_%1$s : \'\',
current_module_class_value = typeof et_pb_module_class_%1$s !== \'undefined\' ? et_pb_module_class_%1$s : \'\',
current_custom_css_before_value = typeof et_pb_custom_css_before_%1$s !== \'undefined\' ? et_pb_custom_css_before_%1$s : \'\',
current_custom_css_main_value = typeof et_pb_custom_css_main_%1$s !== \'undefined\' ? et_pb_custom_css_main_%1$s : \'\',
current_custom_css_after_value = typeof et_pb_custom_css_after_%1$s !== \'undefined\' ? et_pb_custom_css_after_%1$s : \'\';
function generate_column_vars_bg() {
for ( $i = 1; $i < 4; $i++ ) {
current_value_bg = typeof et_pb_background_color_%1$s !== \'undefined\' ? et_pb_background_color_%1$s : \'\',
current_value_bg_img = typeof et_pb_bg_img_%1$s !== \'undefined\' ? et_pb_bg_img_%1$s : \'\';
current_background_size_cover = typeof et_pb_background_size_%1$s !== \'undefined\' && et_pb_background_size_%1$s === \'cover\' ? \' selected="selected"\' : \'\';
current_background_size_contain = typeof et_pb_background_size_%1$s !== \'undefined\' && et_pb_background_size_%1$s === \'contain\' ? \' selected="selected"\' : \'\';
current_background_size_initial = typeof et_pb_background_size_%1$s !== \'undefined\' && et_pb_background_size_%1$s === \'initial\' ? \' selected="selected"\' : \'\';
current_background_position_topleft = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'top_left\' ? \' selected="selected"\' : \'\';
current_background_position_topcenter = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'top_center\' ? \' selected="selected"\' : \'\';
current_background_position_topright = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'top_right\' ? \' selected="selected"\' : \'\';
current_background_position_centerleft = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'center_left\' ? \' selected="selected"\' : \'\';
current_background_position_center = typeof et_pb_background_position_%1$s === \'undefined\' || et_pb_background_position_%1$s === \'center\' ? \' selected="selected"\' : \'\';
current_background_position_centerright = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'center_right\' ? \' selected="selected"\' : \'\';
current_background_position_bottomleft = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'bottom_left\' ? \' selected="selected"\' : \'\';
current_background_position_bottomcenter = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'bottom_center\' ? \' selected="selected"\' : \'\';
current_background_position_bottomright = typeof et_pb_background_position_%1$s !== \'undefined\' && et_pb_background_position_%1$s === \'bottom_right\' ? \' selected="selected"\' : \'\';
current_background_repeat_repeat = typeof et_pb_background_repeat_%1$s === \'undefined\' || et_pb_background_repeat_%1$s === \'repeat\' ? \' selected="selected"\' : \'\';
current_background_repeat_repeatx = typeof et_pb_background_repeat_%1$s !== \'undefined\' && et_pb_background_repeat_%1$s === \'repeat-x\' ? \' selected="selected"\' : \'\';
current_background_repeat_repeaty = typeof et_pb_background_repeat_%1$s !== \'undefined\' && et_pb_background_repeat_%1$s === \'repeat-y\' ? \' selected="selected"\' : \'\';
current_background_repeat_space = typeof et_pb_background_repeat_%1$s !== \'undefined\' && et_pb_background_repeat_%1$s === \'space\' ? \' selected="selected"\' : \'\';
current_background_repeat_round = typeof et_pb_background_repeat_%1$s !== \'undefined\' && et_pb_background_repeat_%1$s === \'round\' ? \' selected="selected"\' : \'\';
current_background_repeat_norepeat = typeof et_pb_background_repeat_%1$s !== \'undefined\' && et_pb_background_repeat_%1$s === \'no-repeat\' ? \' selected="selected"\' : \'\';
current_background_blend_normal = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'normal\' ? \' selected="selected"\' : \'\';
current_background_blend_multiply = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'multiply\' ? \' selected="selected"\' : \'\';
current_background_blend_screen = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'screen\' ? \' selected="selected"\' : \'\';
current_background_blend_overlay = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'overlay\' ? \' selected="selected"\' : \'\';
current_background_blend_darken = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'darken\' ? \' selected="selected"\' : \'\';
current_background_blend_lighten = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'lighten\' ? \' selected="selected"\' : \'\';
current_background_blend_colordodge = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'color-dodge\' ? \' selected="selected"\' : \'\';
current_background_blend_colorburn = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'color-burn\' ? \' selected="selected"\' : \'\';
current_background_blend_hardlight = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'hard-light\' ? \' selected="selected"\' : \'\';
current_background_blend_softlight = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'soft-light\' ? \' selected="selected"\' : \'\';
current_background_blend_difference = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'difference\' ? \' selected="selected"\' : \'\';
current_background_blend_exclusion = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'hue\' ? \' selected="selected"\' : \'\';
current_background_blend_hue = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'saturation\' ? \' selected="selected"\' : \'\';
current_background_blend_saturation = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'color\' ? \' selected="selected"\' : \'\';
current_background_blend_color = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'normal\' ? \' selected="selected"\' : \'\';
current_background_blend_luminosity = typeof et_pb_background_blend_%1$s !== \'undefined\' && et_pb_background_blend_%1$s === \'luminosity\' ? \' selected="selected"\' : \'\';
current_use_background_color_gradient = typeof et_pb_use_background_color_gradient_%1$s !== \'undefined\' && \'on\' === et_pb_use_background_color_gradient_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_start = typeof et_pb_background_color_gradient_start_%1$s !== \'undefined\' ? et_pb_background_color_gradient_start_%1$s : \'%2$s\';
current_background_color_gradient_end = typeof et_pb_background_color_gradient_end_%1$s !== \'undefined\' ? et_pb_background_color_gradient_end_%1$s : \'%3$s\';
current_background_color_gradient_type = typeof et_pb_background_color_gradient_type_%1$s !== \'undefined\' && \'radial\' === et_pb_background_color_gradient_type_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction = typeof et_pb_background_color_gradient_direction_%1$s !== \'undefined\' ? et_pb_background_color_gradient_direction_%1$s : \'%4$s\';
current_background_color_gradient_direction_radial_center = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'center\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction_radial_top_left = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'top left\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction_radial_top = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'top\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction_radial_top_right = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'top right\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction_radial_right = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'right\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';
current_background_color_gradient_direction_radial_bottom_right = typeof et_pb_background_color_gradient_direction_radial_%1$s !== \'undefined\' && \'bottom right\' === et_pb_background_color_gradient_direction_radial_%1$s ? \' selected="selected"\' : \'\';