: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_parent_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
} elseif ( $shapes_type === 'parallelogram' ) {
$shapes_square_size_style = sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size ), ( esc_html( $shapes_square_size ) / 2 ) );
$shapes_square_size_tablet_style = '' !== $shapes_square_size_tablet ? sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size_tablet ), ( esc_html( $shapes_square_size_tablet ) / 2 ) ) : '';
$shapes_square_size_phone_style = '' !== $shapes_square_size_phone ? sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size_phone ), ( esc_html( $shapes_square_size_phone ) / 2 ) ) : '';
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_style,
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
} elseif ( $shapes_type === 'diamond_square' ) {
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_style,
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
} elseif ( $shapes_type === 'hexagon' ) {
$shapes_square_size_style = sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size ), ( esc_html( $shapes_square_size ) / 1.77 ) );
$shapes_square_size_tablet_style = '' !== $shapes_square_size_tablet ? sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size_tablet ), ( esc_html( $shapes_square_size_tablet ) / 1.77 ) ) : '';
$shapes_square_size_phone_style = '' !== $shapes_square_size_phone ? sprintf( 'height: %2$spx; width: %1$spx;', esc_html( $shapes_square_size_phone ), ( esc_html( $shapes_square_size_phone ) / 1.77 ) ) : '';
$shapes_square_size_before_style = sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-bottom: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size ) / 2 ), ( esc_html( $shapes_square_size ) / 4 ) );
$shapes_square_size_before_tablet_style = '' !== $shapes_square_size_tablet ? sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-bottom: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size_tablet ) / 2 ), ( esc_html( $shapes_square_size_tablet ) / 4 ) ) : '';
$shapes_square_size_before_phone_style = '' !== $shapes_square_size_phone ? sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-bottom: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size_phone ) / 2 ), ( esc_html( $shapes_square_size_phone ) / 4 ) ) : '';
$shapes_square_size_after_style = sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-top: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size ) / 2 ), ( esc_html( $shapes_square_size ) / 4 ) );
$shapes_square_size_after_tablet_style = '' !== $shapes_square_size_tablet ? sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-top: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size_tablet ) / 2 ), ( esc_html( $shapes_square_size_tablet ) / 4 ) ) : '';
$shapes_square_size_after_phone_style = '' !== $shapes_square_size_phone ? sprintf( 'border-left: %2$spx solid transparent; border-right: %2$spx solid transparent; border-top: %3$spx solid %1$s', esc_attr( $shape_color ), ( esc_html( $shapes_square_size_phone ) / 2 ), ( esc_html( $shapes_square_size_phone ) / 4 ) ) : '';
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_style,
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => sprintf( 'margin: %1$spx 0;', ( esc_html( $shapes_square_size ) / 4 ) ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => sprintf( 'margin: %1$spx 0;', ( (int) esc_html( $shapes_square_size_tablet ) / 4 ) ),
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => sprintf( 'margin: %1$spx 0;', ( (int) esc_html( $shapes_square_size_phone ) / 4 ) ),
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:before',
'declaration' => $shapes_square_size_before_style,
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:before',
'declaration' => $shapes_square_size_before_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:before',
'declaration' => $shapes_square_size_before_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:after',
'declaration' => $shapes_square_size_after_style,
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:after',
'declaration' => $shapes_square_size_after_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_shapes_wrapper:after',
'declaration' => $shapes_square_size_after_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_style,
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shapes_square_size_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
$shape_color_tablet_style = '';
$shape_color_phone_style = '';
if ( $shapes_type === 'square' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'circle' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'rectangle' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'triangle' ) {
$shape_color_style = sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'oval' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'trapezoid' ) {
$shape_color_style = sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'border-bottom-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'parallelogram' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'diamond_square' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
} elseif ( $shapes_type === 'hexagon' ) {
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
$shape_color_style = sprintf( 'background-color: %1$s;', esc_attr( $shape_color ) );
$shape_color_tablet_style = '' !== $shape_color_tablet ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_tablet ) ) : '';
$shape_color_phone_style = '' !== $shape_color_phone ? sprintf( 'background-color: %1$s;', esc_attr( $shape_color_phone ) ) : '';
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shape_color_style,
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shape_color_tablet_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
ET_Builder_Element::set_style(
'selector' => $shape_selector,
'declaration' => $shape_color_phone_style,
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
// Remove automatically added classnames
// Render module content.
<div class="dsm_shapes_wrapper dsm_shapes_%3$s">
$parallax_image_background,
if ( isset( get_option( 'dsm_settings_misc' )['dsm_dynamic_assets'] ) && ! empty( get_option( 'dsm_settings_misc' )['dsm_dynamic_assets'] ) && 'on' === get_option( 'dsm_settings_misc' )['dsm_dynamic_assets'] ) {
if ( isset( get_option( 'dsm_settings_misc' )['dsm_dynamic_assets_compatibility'] ) && ! empty( get_option( 'dsm_settings_misc' )['dsm_dynamic_assets'] ) && 'on' === get_option( 'dsm_settings_misc' )['dsm_dynamic_assets_compatibility'] ) {
wp_enqueue_style( 'dsm-shapes', plugin_dir_url( __DIR__ ) . 'Shapes/style.css', array(), DSM_VERSION, 'all' );
add_filter( 'et_global_assets_list', array( $this, 'dsm_load_required_divi_assets' ), 10, 3 );
add_filter( 'et_late_global_assets_list', array( $this, 'dsm_load_required_divi_assets' ), 10, 3 );
public function apply_custom_margin_padding( $function_name, $slug, $type, $class, $important = false ) {
$slug_value = $this->props[ $slug ];
$slug_value_tablet = $this->props[ $slug . '_tablet' ];
$slug_value_phone = $this->props[ $slug . '_phone' ];
$slug_value_last_edited = $this->props[ $slug . '_last_edited' ];
$slug_value_responsive_active = et_pb_get_responsive_status( $slug_value_last_edited );
if ( isset( $slug_value ) && ! empty( $slug_value ) ) {
ET_Builder_Element::set_style(
'declaration' => et_builder_get_element_style_css( $slug_value, $type, $important ),
if ( isset( $slug_value_tablet ) && ! empty( $slug_value_tablet ) && $slug_value_responsive_active ) {
ET_Builder_Element::set_style(
'declaration' => et_builder_get_element_style_css( $slug_value_tablet, $type, $important ),
'media_query' => ET_Builder_Element::get_media_query( 'max_width_980' ),
if ( isset( $slug_value_phone ) && ! empty( $slug_value_phone ) && $slug_value_responsive_active ) {
ET_Builder_Element::set_style(
'declaration' => et_builder_get_element_style_css( $slug_value_phone, $type, $important ),
'media_query' => ET_Builder_Element::get_media_query( 'max_width_767' ),
if ( et_builder_is_hover_enabled( $slug, $this->props ) ) {
if ( isset( $this->props[ $slug . '__hover' ] ) ) {
$hover = $this->props[ $slug . '__hover' ];
ET_Builder_Element::set_style(
'selector' => $this->add_hover_to_order_class( $class ),
'declaration' => et_builder_get_element_style_css( $hover, $type, $important ),
* Force load global styles.
* @param array $assets_list Current global assets on the list.
public function dsm_load_required_divi_assets( $assets_list, $assets_args, $instance ) {
$assets_prefix = et_get_dynamic_assets_path();
$all_shortcodes = $instance->get_saved_page_shortcodes();
$this->_cpt_suffix = et_builder_should_wrap_styles() && ! et_is_builder_plugin_active() ? '_cpt' : '';
if ( ! isset( $assets_list['et_jquery_magnific_popup'] ) ) {
$assets_list['et_jquery_magnific_popup'] = array(
'css' => "{$assets_prefix}/css/magnific_popup.css",
if ( ! isset( $assets_list['et_pb_overlay'] ) ) {
$assets_list['et_pb_overlay'] = array(
'css' => "{$assets_prefix}/css/overlay{$this->_cpt_suffix}.css",
if ( ! isset( $assets_list['dsm_shapes'] ) ) {
$assets_list['dsm_shapes'] = array(
'css' => plugin_dir_url( __DIR__ ) . 'Shapes/style.css',