: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$button_two_tooltip = $this->props['button_two_tooltip'];
$button_two_tooltip_content = $this->props['button_two_tooltip_content'];
$button_two_tooltip_placement = $this->props['button_two_tooltip_placement'];
$button_two_tooltip_size = $this->props['button_two_tooltip_size'];
$button_two_tooltip_arrow = $this->props['button_two_tooltip_arrow'];
$button_two_tooltip_animation = $this->props['button_two_tooltip_animation'];
// $button_two_tooltip_distance = floatval($this->props['button_two_tooltip_distance']);
$button_two_tooltip_bg_color = $this->props['button_two_tooltip_bg_color'];
$button_two_rel = $this->props['button_two_rel'];
$button_two_on_hover = $this->props['button_two_on_hover'];
$button_two_icon_hover_animation = $this->props['button_two_icon_hover_animation'];
$background_layout = $this->props['background_layout'];
$background_layout_hover = et_pb_hover_options()->get_value( 'background_layout', $this->props, 'light' );
$background_layout_hover_enabled = et_pb_hover_options()->is_enabled( 'background_layout', $this->props );
$background_layout_values = et_pb_responsive_options()->get_property_values( $this->props, 'background_layout' );
$background_layout_tablet = isset( $background_layout_values['tablet'] ) ? $background_layout_values['tablet'] : '';
$background_layout_phone = isset( $background_layout_values['phone'] ) ? $background_layout_values['phone'] : '';
$button_one_url_new_window = $this->props['button_one_url_new_window'];
$button_two_url_new_window = $this->props['button_two_url_new_window'];
$custom_icon_1 = $this->props['button_one_icon'];
$button_custom_1 = $this->props['custom_button_one'];
$custom_icon_2 = $this->props['button_two_icon'];
$button_custom_2 = $this->props['custom_button_two'];
$button_alignment = $this->get_button_alignment();
$is_button_aligment_responsive = et_pb_responsive_options()->is_responsive_enabled( $this->props, 'button_alignment' );
$button_alignment_tablet = $is_button_aligment_responsive ? $this->get_button_alignment( 'tablet' ) : '';
$button_alignment_phone = $is_button_aligment_responsive ? $this->get_button_alignment( 'phone' ) : '';
$separator_text = $this->props['separator_text'];
$separator_gap = $this->props['separator_gap'];
$separator_gap_tablet = $this->props['separator_gap_tablet'];
$separator_gap_phone = $this->props['separator_gap_phone'];
$separator_gap_last_edited = $this->props['separator_gap_last_edited'];
$button_one_hover_animation = $this->props['button_one_hover_animation'];
$button_two_hover_animation = $this->props['button_two_hover_animation'];
$fullwidth_separator_text_on_mobile = $this->props['fullwidth_separator_text_on_mobile'];
$remove_separator_text_on_mobile = $this->props['remove_separator_text_on_mobile'];
$button_one_url = trim( $button_one_url );
$button_two_url = trim( $button_two_url );
$button_one_id = $this->props['button_one_id'];
$button_one_css = $this->props['button_one_css'];
$button_two_id = $this->props['button_two_id'];
$button_two_css = $this->props['button_two_css'];
$button_alignments = array();
if ( ! empty( $button_alignment ) ) {
array_push( $button_alignments, sprintf( 'et_pb_button_alignment_%1$s', esc_attr( $button_alignment ) ) );
if ( ! empty( $button_alignment_tablet ) ) {
array_push( $button_alignments, sprintf( 'et_pb_button_alignment_tablet_%1$s', esc_attr( $button_alignment_tablet ) ) );
if ( ! empty( $button_alignment_phone ) ) {
array_push( $button_alignments, sprintf( 'et_pb_button_alignment_phone_%1$s', esc_attr( $button_alignment_phone ) ) );
$button_alignment_classes = join( ' ', $button_alignments );
$separator_gap_responsive_active = et_pb_get_responsive_status( $separator_gap_last_edited );
$separator_gap_values = array(
'desktop' => $separator_gap,
'tablet' => $separator_gap_responsive_active ? $separator_gap_tablet : '',
'phone' => $separator_gap_responsive_active ? $separator_gap_phone : '',
et_pb_responsive_options()->generate_responsive_css( $separator_gap_values, '%%order_class%% .dsm-button-separator-text', 'margin-left', $render_slug );
et_pb_responsive_options()->generate_responsive_css( $separator_gap_values, '%%order_class%% .dsm-button-separator-text', 'margin-right', $render_slug );
if ( 'none' !== $this->props['button_one_lightbox_max_width'] ) {
et_pb_responsive_options()->generate_responsive_css( $button_one_lightbox_max_width_values, '%%order_class%%.dsm_button_one_lightbox.dsm-lightbox-custom .mfp-content', 'max-width', $render_slug, '', 'max-width' );
if ( 'rgba(255,255,255,0.2)' !== $this->props['button_one_lightbox_close_color'] ) {
et_pb_responsive_options()->generate_responsive_css( $button_one_lightbox_close_color_values, '%%order_class%%.dsm_button_one_lightbox.dsm-lightbox-custom .mfp-close', 'color', $render_slug, '', 'color' );
if ( $hover->is_enabled( 'button_one_lightbox_close_color', $this->props ) && $hover->get_value( 'button_one_lightbox_close_color', $this->props ) ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%%.dsm_button_one_lightbox.dsm-lightbox-custom .mfp-close:hover',
'declaration' => sprintf(
'color: %1$s !important;',
esc_html( $hover->get_value( 'button_one_lightbox_close_color', $this->props ) )
if ( 'none' !== $this->props['button_two_lightbox_max_width'] ) {
et_pb_responsive_options()->generate_responsive_css( $button_two_lightbox_max_width_values, '%%order_class%%.dsm_button_two_lightbox.dsm-lightbox-custom .mfp-content', 'max-width', $render_slug, '', 'max-width' );
if ( 'rgba(255,255,255,0.2)' !== $this->props['button_two_lightbox_close_color'] ) {
et_pb_responsive_options()->generate_responsive_css( $button_two_lightbox_close_color_values, '%%order_class%%.dsm_button_two_lightbox.dsm-lightbox-custom .mfp-close', 'color', $render_slug, '', 'color' );
if ( $hover->is_enabled( 'button_two_lightbox_close_color', $this->props ) && $hover->get_value( 'button_two_lightbox_close_color', $this->props ) ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%%.dsm_button_two_lightbox.dsm-lightbox-custom .mfp-close:hover',
'declaration' => sprintf(
'color: %1$s !important;',
esc_html( $hover->get_value( 'button_two_lightbox_close_color', $this->props ) )
if ( '' !== $button_one_tooltip_bg_color ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_one.dsm-tooltip:after',
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $button_one_tooltip_bg_color )
if ( 'top' == $button_one_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_one.dsm-tooltip:before',
'declaration' => sprintf(
'border-top-color: %1$s;',
esc_html( $button_one_tooltip_bg_color )
} elseif ( 'bottom' == $button_one_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_one.dsm-tooltip:before',
'declaration' => sprintf(
'border-bottom-color: %1$s;',
esc_html( $button_one_tooltip_bg_color )
} elseif ( 'left' == $button_one_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_one.dsm-tooltip:before',
'declaration' => sprintf(
'border-left-color: %1$s;',
esc_html( $button_one_tooltip_bg_color )
} elseif ( 'right' == $button_one_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_one.dsm-tooltip:before',
'declaration' => sprintf(
'border-right-color: %1$s;',
esc_html( $button_one_tooltip_bg_color )
// Nothing to output if neither Button Text nor Button URL defined
if ( '' !== $button_two_tooltip_bg_color ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_two.dsm-tooltip:after',
'declaration' => sprintf(
'background-color: %1$s;',
esc_html( $button_two_tooltip_bg_color )
if ( 'top' == $button_two_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_two.dsm-tooltip:before',
'declaration' => sprintf(
'border-top-color: %1$s !important;',
esc_html( $button_two_tooltip_bg_color )
} elseif ( 'bottom' == $button_two_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_two.dsm-tooltip:before',
'declaration' => sprintf(
'border-bottom-color: %1$s !important;',
esc_html( $button_two_tooltip_bg_color )
} elseif ( 'left' == $button_two_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_two.dsm-tooltip:before',
'declaration' => sprintf(
'border-left-color: %1$s !important;',
esc_html( $button_two_tooltip_bg_color )
} elseif ( 'right' == $button_two_tooltip_placement ) {
ET_Builder_Element::set_style(
'selector' => '%%order_class%% .dsm_button_two.dsm-tooltip:before',
'declaration' => sprintf(
'border-right-color: %1$s !important;',
esc_html( $button_two_tooltip_bg_color )
$add_class .= " et_pb_bg_layout_{$background_layout}";
if ( ! empty( $background_layout_tablet ) ) {
$add_class .= " et_pb_bg_layout_{$background_layout_tablet}_tablet";
if ( ! empty( $background_layout_phone ) ) {
$add_class .= " et_pb_bg_layout_{$background_layout_phone}_phone";
if ( 'url' === $button_one_url_type ) {
$link_one_url .= sprintf(
'off' !== $button_one_image_popup ? esc_url( $button_one_image_src ) : esc_url( $button_one_url )
} elseif ( 'download' === $button_one_url_type ) {
$link_one_url .= sprintf(
esc_url( $button_one_download_file )
} elseif ( 'email' === $button_one_url_type ) {
$link_one_url .= sprintf(
'mailto:%1$s?%2$s%3$s%4$s%5$s',
'' !== $button_one_email_address ? esc_attr( $button_one_email_address ) : '',
'' !== $button_one_email_cc ? esc_attr( "&cc=$button_one_email_cc" ) : '',
'' !== $button_one_email_bcc ? esc_attr( "&bcc=$button_one_email_bcc" ) : '',
'' !== $button_one_email_subject ? esc_attr( '&subject=' . $button_one_email_subject ) : '',
'' !== $button_one_email_msg ? esc_attr( '&body=' . $button_one_email_msg ) : ''
} elseif ( 'phone' === $button_one_url_type ) {
$link_one_url .= sprintf(
'' !== $button_one_phone_number ? esc_attr( $button_one_phone_number ) : ''
} elseif ( 'sms' === $button_one_url_type ) {
$link_one_url .= sprintf(
'' !== $button_one_sms_number ? esc_attr( $button_one_sms_number ) : '',
'' !== $button_one_sms_body_text ? '?&body=' . rawurlencode( $button_one_sms_body_text ) : ''
} elseif ( 'fb_messenger' === $button_one_url_type ) {
$link_one_url .= sprintf(
'' !== $button_one_fb_messenger ? esc_attr( $button_one_fb_messenger ) : ''
} elseif ( 'skype' === $button_one_url_type ) {
$link_one_url .= sprintf(
'' !== $button_one_skype ? esc_attr( $button_one_skype ) : '',
esc_attr( '?' . $button_one_skype_action_type )
} elseif ( 'whatsapp' === $button_one_url_type ) {
$link_one_url .= sprintf(
'https://wa.me/%1$s%2$s',
'' !== $button_one_whatsapp_number ? esc_attr( $button_one_whatsapp_number ) : '',
'' !== $button_one_whatsapp_msg ? esc_attr( '?text=' . $button_one_whatsapp_msg ) : ''
} elseif ( 'telegram' === $button_one_url_type ) {
$link_one_url .= sprintf(
'' !== $button_one_telegram ? esc_attr( $button_one_telegram ) : '',
'' !== $button_one_telegram_msg ? esc_attr( '?start=' . $button_one_telegram_msg ) : ''
if ( 'url' === $button_two_url_type ) {
$link_two_url .= sprintf(
'off' !== $button_two_image_popup ? esc_url( $button_two_image_src ) : esc_url( $button_two_url )
} elseif ( 'download' === $button_two_url_type ) {
$link_two_url .= sprintf(
esc_url( $button_two_download_file )
} elseif ( 'email' === $button_two_url_type ) {
$link_two_url .= sprintf(
'mailto:%1$s?%2$s%3$s%4$s%5$s',
'' !== $button_two_email_address ? esc_attr( $button_two_email_address ) : '',
'' !== $button_two_email_cc ? esc_attr( "&cc=$button_two_email_cc" ) : '',
'' !== $button_two_email_bcc ? esc_attr( "&bcc=$button_two_email_bcc" ) : '',
'' !== $button_two_email_subject ? esc_attr( '&subject=' . $button_two_email_subject ) : '',
'' !== $button_two_email_msg ? esc_attr( '&body=' . $button_two_email_msg ) : ''
} elseif ( 'phone' === $button_two_url_type ) {
$link_two_url .= sprintf(
'' !== $button_two_phone_number ? esc_attr( $button_two_phone_number ) : ''
} elseif ( 'sms' === $button_two_url_type ) {
$link_two_url .= sprintf(
'' !== $button_two_sms_number ? esc_attr( $button_two_sms_number ) : '',
'' !== $button_two_sms_body_text ? '?&body=' . rawurlencode( $button_two_sms_body_text ) : ''
} elseif ( 'fb_messenger' === $button_two_url_type ) {
$link_two_url .= sprintf(
'' !== $button_two_fb_messenger ? esc_attr( $button_two_fb_messenger ) : ''
} elseif ( 'skype' === $button_two_url_type ) {
$link_two_url .= sprintf(
'' !== $button_two_skype ? esc_attr( $button_two_skype ) : '',
esc_attr( '?' . $button_two_skype_action_type )
} elseif ( 'whatsapp' === $button_two_url_type ) {
$link_two_url .= sprintf(
'https://wa.me/%1$s%2$s',
'' !== $button_two_whatsapp_number ? esc_attr( $button_two_whatsapp_number ) : '',
'' !== $button_two_whatsapp_msg ? esc_attr( '?text=' . $button_two_whatsapp_msg ) : ''
} elseif ( 'telegram' === $button_two_url_type ) {
$link_two_url .= sprintf(
'' !== $button_two_telegram ? esc_attr( $button_two_telegram ) : '',
'' !== $button_two_telegram_msg ? esc_attr( '?start=' . $button_two_telegram_msg ) : ''
if ( '' !== $button_one_text ) {
if ( 'on' === $button_one_tooltip ) {
$button_output .= sprintf(
'<div class="dsm_button_one dsm-tooltip%2$s dsm-tooltip-%3$s"%1$s>',
( 'off' !== $button_one_tooltip ? sprintf(
' data-dsm-tooltip="%1$s" data-dsm-tooltip-placement="%3$s" data-dsm-tooltip-size="%2$s"',
esc_attr( $button_one_tooltip_content ),
esc_attr( $button_one_tooltip_size ),
esc_attr( $button_one_tooltip_placement )
'off' !== $button_one_tooltip_arrow ? '' : ' dsm-tooltip-hide-arrow',
esc_attr( $button_one_tooltip_animation )
$button_output .= sprintf(
'<a%15$s class="et_pb_button et_pb_button_one%5$s%8$s%9$s%10$s%12$s %7$s %14$s" %6$s href="%1$s"%3$s%4$s data-dsm-lightbox-id="dsm_button_one_lightbox %11$s"%13$s>%2$s</a>',
esc_html( $button_one_text ),
( 'on' === $button_one_url_new_window ? ' target="_blank"' : '' ),
'' !== $custom_icon_1 && 'on' === $button_custom_1 ? sprintf(
esc_attr( et_pb_process_font_icon( $custom_icon_1 ) )
'' !== $custom_icon_1 && 'on' === $button_custom_1 ? ' et_pb_custom_button_icon' : '',
$this->get_rel_attributes( $button_one_rel ),
esc_attr( $button_one_hover_animation ),
'off' !== $button_one_video_popup ? ' dsm-video-lightbox' : '',
'off' !== $button_one_image_popup ? ' dsm-image-lightbox' : '',
'off' === $button_one_on_hover && 'dsm-icon-none' !== $button_one_icon_hover_animation ? esc_attr( " {$button_one_icon_hover_animation}" ) : '',
ET_Builder_Element::get_module_order_class( $render_slug ),
( 'download' === $button_one_url_type ? ' download' : '' ),
isset( $button_one_css ) && '' !== $button_one_css ? esc_attr( $button_one_css ) : '',
isset( $button_one_id ) && '' !== $button_one_id ? sprintf( ' id="%1$s"', esc_attr( $button_one_id ) ) : ''
if ( 'on' === $button_one_tooltip ) {
$button_output .= '</div>';
if ( '' !== $separator_text ) {
$button_output .= '<span class="dsm-button-separator-text">' . et_core_esc_previously( $separator_text ) . '</span>';
if ( '' !== $button_two_text ) {
if ( 'on' === $button_two_tooltip ) {
$button_output .= sprintf(
'<div class="dsm_button_two dsm-tooltip%2$s dsm-tooltip-%3$s"%1$s>',
( 'off' !== $button_two_tooltip ? sprintf(
' data-dsm-tooltip="%1$s" data-dsm-tooltip-placement="%3$s" data-dsm-tooltip-size="%2$s"',
esc_attr( $button_two_tooltip_content ),
esc_attr( $button_two_tooltip_size ),
esc_attr( $button_two_tooltip_placement )
'off' !== $button_two_tooltip_arrow ? '' : ' dsm-tooltip-hide-arrow',
esc_attr( $button_two_tooltip_animation )
$button_output .= sprintf(
'<a%15$s class="et_pb_button et_pb_button_two%5$s%8$s%9$s%10$s%12$s %7$s %14$s" %6$s href="%1$s"%3$s%4$s data-dsm-lightbox-id="dsm_button_two_lightbox %11$s"%13$s>%2$s</a>',
esc_html( $button_two_text ),
( 'on' === $button_two_url_new_window ? ' target="_blank"' : '' ),
'' !== $custom_icon_2 && 'on' === $button_custom_2 ? sprintf(
esc_attr( et_pb_process_font_icon( $custom_icon_2 ) )
'' !== $custom_icon_2 && 'on' === $button_custom_2 ? ' et_pb_custom_button_icon' : '',
$this->get_rel_attributes( $button_two_rel ),
esc_attr( $button_two_hover_animation ),
'off' !== $button_two_video_popup ? ' dsm-video-lightbox' : '',
'off' !== $button_two_image_popup ? ' dsm-image-lightbox' : '',
'off' === $button_two_on_hover && 'dsm-icon-none' !== $button_two_icon_hover_animation ? esc_attr( " {$button_two_icon_hover_animation}" ) : '',
ET_Builder_Element::get_module_order_class( $render_slug ),
( 'download' === $button_two_url_type ? ' download' : '' ),
isset( $button_two_css ) && '' !== $button_two_css ? esc_attr( $button_two_css ) : '',
isset( $button_two_id ) && '' !== $button_two_id ? sprintf( ' id="%1$s"', esc_attr( $button_two_id ) ) : ''
if ( 'on' === $button_two_tooltip ) {
$button_output .= '</div>';
$data_background_layout = '';
$data_background_layout_hover = '';
if ( $background_layout_hover_enabled ) {
$data_background_layout = sprintf(
' data-background-layout="%1$s"',
esc_attr( $background_layout )
$data_background_layout_hover = sprintf(
' data-background-layout-hover="%1$s"',
esc_attr( $background_layout_hover )
$this->add_classname( "et_pb_bg_layout_{$background_layout}" );
if ( ! empty( $background_layout_tablet ) ) {
$this->add_classname( "et_pb_bg_layout_{$background_layout_tablet}_tablet" );
if ( ! empty( $background_layout_phone ) ) {
$this->add_classname( "et_pb_bg_layout_{$background_layout_phone}_phone" );
if ( 'on' === $button_one_image_popup || 'on' === $button_two_image_popup ) {
if ( ! wp_script_is( 'dsm-magnific-popup-image', 'enqueued' ) ) {
wp_enqueue_script( 'dsm-magnific-popup-image' );
if ( 'on' === $button_one_video_popup || 'on' === $button_two_video_popup ) {
if ( ! wp_script_is( 'dsm-magnific-popup-video', 'enqueued' ) ) {
wp_enqueue_script( 'dsm-magnific-popup-video' );
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'] ) {
add_filter( 'et_global_assets_list', array( $this, 'dsm_load_magnific_popup_assets' ), 10, 3 );
add_filter( 'et_late_global_assets_list', array( $this, 'dsm_load_magnific_popup_assets' ), 10, 3 );
wp_enqueue_style( 'dsm-button-hover', plugin_dir_url( __DIR__ ) . 'Buttons/hover.css', array(), DSM_VERSION, 'all' );
wp_enqueue_style( 'dsm-button', plugin_dir_url( __DIR__ ) . 'Buttons/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 );
'<div class="et_pb_button_module_wrappers dsm_button_%3$s_wrapper %2$s et_pb_module%4$s%5$s%8$s"%6$s%7$s>
esc_attr( $button_alignment_classes ),
( '' !== $separator_text && 'off' !== $remove_separator_text_on_mobile ? ' dsm-button-separator-remove' : '' ),
( '' !== $separator_text && 'off' !== $fullwidth_separator_text_on_mobile ? ' dsm-button-separator-fullwidth' : '' ),
et_core_esc_previously( $data_background_layout ),
et_core_esc_previously( $data_background_layout_hover ),
( '' !== $separator_text ? ' dsm-button-seperator' : '' )