: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[footer_menu_font_size]', array(
'label' => esc_html__( 'Font Size', 'Divi' ),
'section' => 'et_divi_footer_menu',
$wp_customize->add_setting( 'et_divi[bottom_bar_background_color]', array(
'default' => 'rgba(0,0,0,0.32)',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[bottom_bar_background_color]', array(
'label' => esc_html__( 'Background Color', 'Divi' ),
'section' => 'et_divi_bottom_bar',
'settings' => 'et_divi[bottom_bar_background_color]',
$wp_customize->add_setting( 'et_divi[bottom_bar_text_color]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[bottom_bar_text_color]', array(
'label' => esc_html__( 'Text Color', 'Divi' ),
'section' => 'et_divi_bottom_bar',
'settings' => 'et_divi[bottom_bar_text_color]',
$wp_customize->add_setting( 'et_divi[bottom_bar_font_style]', array(
'default' => et_get_option( 'footer_bottom_bar_font_style', '' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_font_style',
$wp_customize->add_control( new ET_Divi_Font_Style_Option ( $wp_customize, 'et_divi[bottom_bar_font_style]', array(
'label' => esc_html__( 'Font Style', 'Divi' ),
'section' => 'et_divi_bottom_bar',
'choices' => et_divi_font_style_choices(),
$wp_customize->add_setting( 'et_divi[bottom_bar_font_size]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[bottom_bar_font_size]', array(
'label' => esc_html__( 'Font Size', 'Divi' ),
'section' => 'et_divi_bottom_bar',
$wp_customize->add_setting( 'et_divi[bottom_bar_social_icon_size]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[bottom_bar_social_icon_size]', array(
'label' => esc_html__( 'Social Icon Size', 'Divi' ),
'section' => 'et_divi_bottom_bar',
$wp_customize->add_setting( 'et_divi[bottom_bar_social_icon_color]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[bottom_bar_social_icon_color]', array(
'label' => esc_html__( 'Social Icon Color', 'Divi' ),
'section' => 'et_divi_bottom_bar',
'settings' => 'et_divi[bottom_bar_social_icon_color]',
$wp_customize->add_setting( 'et_divi[disable_custom_footer_credits]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_validate_boolean',
$wp_customize->add_control( 'et_divi[disable_custom_footer_credits]', array(
'label' => esc_html__( 'Disable Footer Credits', 'Divi' ),
'section' => 'et_divi_bottom_bar',
$wp_customize->add_setting( 'et_divi[custom_footer_credits]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_html_input_text',
$wp_customize->add_control( 'et_divi[custom_footer_credits]', array(
'label' => esc_html__( 'Edit Footer Credits', 'Divi' ),
'section' => 'et_divi_bottom_bar',
'settings' => 'et_divi[custom_footer_credits]',
$wp_customize->add_setting( 'et_divi[all_buttons_font_size]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_font_size', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_font_size]', array(
'label' => esc_html__( 'Text Size', 'Divi' ),
'section' => 'et_divi_buttons',
$wp_customize->add_setting( 'et_divi[all_buttons_text_color]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_text_color]', array(
'label' => esc_html__( 'Text Color', 'Divi' ),
'section' => 'et_divi_buttons',
'settings' => 'et_divi[all_buttons_text_color]',
$wp_customize->add_setting( 'et_divi[all_buttons_bg_color]', array(
'default' => 'rgba(0,0,0,0)',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_bg_color]', array(
'label' => esc_html__( 'Background Color', 'Divi' ),
'section' => 'et_divi_buttons',
'settings' => 'et_divi[all_buttons_bg_color]',
$wp_customize->add_setting( 'et_divi[all_buttons_border_width]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_border_width', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_border_width]', array(
'label' => esc_html__( 'Border Width', 'Divi' ),
'section' => 'et_divi_buttons',
$wp_customize->add_setting( 'et_divi[all_buttons_border_color]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_border_color]', array(
'label' => esc_html__( 'Border Color', 'Divi' ),
'section' => 'et_divi_buttons',
'settings' => 'et_divi[all_buttons_border_color]',
$wp_customize->add_setting( 'et_divi[all_buttons_border_radius]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_border_radius', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_border_radius]', array(
'label' => esc_html__( 'Border Radius', 'Divi' ),
'section' => 'et_divi_buttons',
$wp_customize->add_setting( 'et_divi[all_buttons_spacing]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_spacing', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_int_number',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_spacing]', array(
'label' => esc_html__( 'Letter Spacing', 'Divi' ),
'section' => 'et_divi_buttons',
$wp_customize->add_setting( 'et_divi[all_buttons_font_style]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_font_style',
$wp_customize->add_control( new ET_Divi_Font_Style_Option ( $wp_customize, 'et_divi[all_buttons_font_style]', array(
'label' => esc_html__( 'Button Font Style', 'Divi' ),
'section' => 'et_divi_buttons',
'choices' => et_divi_font_style_choices(),
if ( ! isset( $et_one_font_languages[$site_domain] ) ) {
$wp_customize->add_setting( 'et_divi[all_buttons_font]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_font_choices',
$wp_customize->add_control( new ET_Divi_Select_Option ( $wp_customize, 'et_divi[all_buttons_font]', array(
'label' => esc_html__( 'Buttons Font', 'Divi' ),
'section' => 'et_divi_buttons',
'settings' => 'et_divi[all_buttons_font]',
'choices' => $font_choices
$wp_customize->add_setting( 'et_divi[all_buttons_icon]', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'et_sanitize_yes_no',
$wp_customize->add_control( 'et_divi[all_buttons_icon]', array(
'label' => esc_html__( 'Add Button Icon', 'Divi' ),
'section' => 'et_divi_buttons',
'choices' => et_divi_yes_no_choices(),
$wp_customize->add_setting( 'et_divi[all_buttons_selected_icon]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_font_icon',
$wp_customize->add_control( new ET_Divi_Icon_Picker_Option ( $wp_customize, 'et_divi[all_buttons_selected_icon]', array(
'label' => esc_html__( 'Select Icon', 'Divi' ),
'section' => 'et_divi_buttons',
$wp_customize->add_setting( 'et_divi[all_buttons_icon_color]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_icon_color]', array(
'label' => esc_html__( 'Icon Color', 'Divi' ),
'section' => 'et_divi_buttons',
'settings' => 'et_divi[all_buttons_icon_color]',
$wp_customize->add_setting( 'et_divi[all_buttons_icon_placement]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_left_right',
$wp_customize->add_control( 'et_divi[all_buttons_icon_placement]', array(
'label' => esc_html__( 'Icon Placement', 'Divi' ),
'section' => 'et_divi_buttons',
'choices' => et_divi_left_right_choices(),
$wp_customize->add_setting( 'et_divi[all_buttons_icon_hover]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_yes_no',
$wp_customize->add_control( 'et_divi[all_buttons_icon_hover]', array(
'label' => esc_html__( 'Only Show Icon on Hover', 'Divi' ),
'section' => 'et_divi_buttons',
'choices' => et_divi_yes_no_choices(),
$wp_customize->add_setting( 'et_divi[all_buttons_text_color_hover]', array(
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_text_color_hover]', array(
'label' => esc_html__( 'Text Color', 'Divi' ),
'section' => 'et_divi_buttons_hover',
'settings' => 'et_divi[all_buttons_text_color_hover]',
$wp_customize->add_setting( 'et_divi[all_buttons_bg_color_hover]', array(
'default' => 'rgba(255,255,255,0.2)',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_bg_color_hover]', array(
'label' => esc_html__( 'Background Color', 'Divi' ),
'section' => 'et_divi_buttons_hover',
'settings' => 'et_divi[all_buttons_bg_color_hover]',
$wp_customize->add_setting( 'et_divi[all_buttons_border_color_hover]', array(
'default' => 'rgba(0,0,0,0)',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_alpha_color',
$wp_customize->add_control( new ET_Divi_Customize_Color_Alpha_Control( $wp_customize, 'et_divi[all_buttons_border_color_hover]', array(
'label' => esc_html__( 'Border Color', 'Divi' ),
'section' => 'et_divi_buttons_hover',
'settings' => 'et_divi[all_buttons_border_color_hover]',
$wp_customize->add_setting( 'et_divi[all_buttons_border_radius_hover]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_border_radius_hover', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'absint'
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_border_radius_hover]', array(
'label' => esc_html__( 'Border Radius', 'Divi' ),
'section' => 'et_divi_buttons_hover',
$wp_customize->add_setting( 'et_divi[all_buttons_spacing_hover]', array(
'default' => ET_Global_Settings::get_value( 'all_buttons_spacing_hover', 'default' ),
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => 'et_sanitize_int_number',
$wp_customize->add_control( new ET_Divi_Range_Option ( $wp_customize, 'et_divi[all_buttons_spacing_hover]', array(
'label' => esc_html__( 'Letter Spacing', 'Divi' ),
'section' => 'et_divi_buttons_hover',
* Add action hook to the footer in customizer preview.
function et_customizer_preview_footer_action() {
if ( is_customize_preview() ) {
do_action( 'et_customizer_footer_preview' );
add_action( 'wp_footer', 'et_customizer_preview_footer_action' );
* Add container with social icons to the footer in customizer preview.
* Used to get the icons and append them into the header when user enables the header social icons in customizer.
function et_load_social_icons() {
$post_id = is_singular() ? get_the_ID() : 0;
$is_custom_post_type = et_builder_post_is_of_custom_post_type( $post_id );
echo '<div class="et_customizer_social_icons" style="display:none;">';
get_template_part( 'includes/social_icons', 'header' );
<script type="text/javascript">
var isCustomPostType = <?php echo json_encode( $is_custom_post_type ); ?>;
$(document).ready(function() {
$(document).trigger('et-customizer-preview-load', {
isCustomPostType: isCustomPostType,
selectorWrapper: <?php echo json_encode( ET_BUILDER_CSS_PREFIX ); ?>
add_action( 'et_customizer_footer_preview', 'et_load_social_icons' );
function et_divi_customize_preview_js() {
$theme_version = et_get_theme_version();
wp_enqueue_script( 'divi-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), $theme_version, true );
wp_localize_script( 'divi-customizer', 'et_main_customizer_data', array(
'original_footer_credits' => et_get_original_footer_credits(),
add_action( 'customize_preview_init', 'et_divi_customize_preview_js' );
function et_divi_customize_preview_js_context() {
// Run in the wp_enqueue_scripts hook as it fires late enough that the main WP query has been resolved.
$layouts = et_theme_builder_get_template_layouts();
wp_localize_script( 'divi-customizer', 'et_theme_builder_customizer_data', array(
'hasHeaderLayout' => ! empty( $layouts ) && $layouts[ ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ]['override'],
'hasFooterLayout' => ! empty( $layouts ) && $layouts[ ET_THEME_BUILDER_FOOTER_LAYOUT_POST_TYPE ]['override'],