Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi
File: functions.php
)
[4500] Fix | Delete
);
[4501] Fix | Delete
[4502] Fix | Delete
$wp_customize->add_control(
[4503] Fix | Delete
new ET_Divi_Select_Option(
[4504] Fix | Delete
$wp_customize,
[4505] Fix | Delete
'et_divi[all_buttons_font]',
[4506] Fix | Delete
array(
[4507] Fix | Delete
'label' => esc_html__( 'Buttons Font', 'Divi' ),
[4508] Fix | Delete
'section' => 'et_divi_buttons',
[4509] Fix | Delete
'settings' => 'et_divi[all_buttons_font]',
[4510] Fix | Delete
'type' => 'select',
[4511] Fix | Delete
'choices' => $font_choices,
[4512] Fix | Delete
)
[4513] Fix | Delete
)
[4514] Fix | Delete
);
[4515] Fix | Delete
[4516] Fix | Delete
$wp_customize->add_setting(
[4517] Fix | Delete
'et_divi[all_buttons_icon]',
[4518] Fix | Delete
array(
[4519] Fix | Delete
'default' => 'yes',
[4520] Fix | Delete
'type' => 'option',
[4521] Fix | Delete
'capability' => 'edit_theme_options',
[4522] Fix | Delete
'sanitize_callback' => 'et_sanitize_yes_no',
[4523] Fix | Delete
)
[4524] Fix | Delete
);
[4525] Fix | Delete
[4526] Fix | Delete
$wp_customize->add_control(
[4527] Fix | Delete
'et_divi[all_buttons_icon]',
[4528] Fix | Delete
array(
[4529] Fix | Delete
'label' => esc_html__( 'Add Button Icon', 'Divi' ),
[4530] Fix | Delete
'section' => 'et_divi_buttons',
[4531] Fix | Delete
'type' => 'select',
[4532] Fix | Delete
'choices' => et_divi_yes_no_choices(),
[4533] Fix | Delete
)
[4534] Fix | Delete
);
[4535] Fix | Delete
[4536] Fix | Delete
$wp_customize->add_setting(
[4537] Fix | Delete
'et_divi[all_buttons_selected_icon]',
[4538] Fix | Delete
array(
[4539] Fix | Delete
'default' => '5',
[4540] Fix | Delete
'type' => 'option',
[4541] Fix | Delete
'capability' => 'edit_theme_options',
[4542] Fix | Delete
'transport' => 'postMessage',
[4543] Fix | Delete
'sanitize_callback' => 'et_sanitize_font_icon',
[4544] Fix | Delete
)
[4545] Fix | Delete
);
[4546] Fix | Delete
[4547] Fix | Delete
$wp_customize->add_control(
[4548] Fix | Delete
new ET_Divi_Icon_Picker_Option(
[4549] Fix | Delete
$wp_customize,
[4550] Fix | Delete
'et_divi[all_buttons_selected_icon]',
[4551] Fix | Delete
array(
[4552] Fix | Delete
'label' => esc_html__( 'Select Icon', 'Divi' ),
[4553] Fix | Delete
'section' => 'et_divi_buttons',
[4554] Fix | Delete
'type' => 'icon_picker',
[4555] Fix | Delete
)
[4556] Fix | Delete
)
[4557] Fix | Delete
);
[4558] Fix | Delete
[4559] Fix | Delete
$wp_customize->add_setting(
[4560] Fix | Delete
'et_divi[all_buttons_icon_color]',
[4561] Fix | Delete
array(
[4562] Fix | Delete
'default' => '#ffffff',
[4563] Fix | Delete
'type' => 'option',
[4564] Fix | Delete
'capability' => 'edit_theme_options',
[4565] Fix | Delete
'transport' => 'postMessage',
[4566] Fix | Delete
'sanitize_callback' => 'et_sanitize_alpha_color',
[4567] Fix | Delete
)
[4568] Fix | Delete
);
[4569] Fix | Delete
[4570] Fix | Delete
$wp_customize->add_control(
[4571] Fix | Delete
new ET_Divi_Customize_Color_Alpha_Control(
[4572] Fix | Delete
$wp_customize,
[4573] Fix | Delete
'et_divi[all_buttons_icon_color]',
[4574] Fix | Delete
array(
[4575] Fix | Delete
'label' => esc_html__( 'Icon Color', 'Divi' ),
[4576] Fix | Delete
'section' => 'et_divi_buttons',
[4577] Fix | Delete
'settings' => 'et_divi[all_buttons_icon_color]',
[4578] Fix | Delete
)
[4579] Fix | Delete
)
[4580] Fix | Delete
);
[4581] Fix | Delete
[4582] Fix | Delete
$wp_customize->add_setting(
[4583] Fix | Delete
'et_divi[all_buttons_icon_placement]',
[4584] Fix | Delete
array(
[4585] Fix | Delete
'default' => 'right',
[4586] Fix | Delete
'type' => 'option',
[4587] Fix | Delete
'capability' => 'edit_theme_options',
[4588] Fix | Delete
'transport' => 'postMessage',
[4589] Fix | Delete
'sanitize_callback' => 'et_sanitize_left_right',
[4590] Fix | Delete
)
[4591] Fix | Delete
);
[4592] Fix | Delete
[4593] Fix | Delete
$wp_customize->add_control(
[4594] Fix | Delete
'et_divi[all_buttons_icon_placement]',
[4595] Fix | Delete
array(
[4596] Fix | Delete
'label' => esc_html__( 'Icon Placement', 'Divi' ),
[4597] Fix | Delete
'section' => 'et_divi_buttons',
[4598] Fix | Delete
'type' => 'select',
[4599] Fix | Delete
'choices' => et_divi_left_right_choices(),
[4600] Fix | Delete
)
[4601] Fix | Delete
);
[4602] Fix | Delete
[4603] Fix | Delete
$wp_customize->add_setting(
[4604] Fix | Delete
'et_divi[all_buttons_icon_hover]',
[4605] Fix | Delete
array(
[4606] Fix | Delete
'default' => 'yes',
[4607] Fix | Delete
'type' => 'option',
[4608] Fix | Delete
'capability' => 'edit_theme_options',
[4609] Fix | Delete
'transport' => 'postMessage',
[4610] Fix | Delete
'sanitize_callback' => 'et_sanitize_yes_no',
[4611] Fix | Delete
)
[4612] Fix | Delete
);
[4613] Fix | Delete
[4614] Fix | Delete
$wp_customize->add_control(
[4615] Fix | Delete
'et_divi[all_buttons_icon_hover]',
[4616] Fix | Delete
array(
[4617] Fix | Delete
'label' => esc_html__( 'Only Show Icon on Hover', 'Divi' ),
[4618] Fix | Delete
'section' => 'et_divi_buttons',
[4619] Fix | Delete
'type' => 'select',
[4620] Fix | Delete
'choices' => et_divi_yes_no_choices(),
[4621] Fix | Delete
)
[4622] Fix | Delete
);
[4623] Fix | Delete
[4624] Fix | Delete
$wp_customize->add_setting(
[4625] Fix | Delete
'et_divi[all_buttons_text_color_hover]',
[4626] Fix | Delete
array(
[4627] Fix | Delete
'default' => '',
[4628] Fix | Delete
'type' => 'option',
[4629] Fix | Delete
'capability' => 'edit_theme_options',
[4630] Fix | Delete
'transport' => 'postMessage',
[4631] Fix | Delete
'sanitize_callback' => 'et_sanitize_alpha_color',
[4632] Fix | Delete
)
[4633] Fix | Delete
);
[4634] Fix | Delete
[4635] Fix | Delete
$wp_customize->add_control(
[4636] Fix | Delete
new ET_Divi_Customize_Color_Alpha_Control(
[4637] Fix | Delete
$wp_customize,
[4638] Fix | Delete
'et_divi[all_buttons_text_color_hover]',
[4639] Fix | Delete
array(
[4640] Fix | Delete
'label' => esc_html__( 'Text Color', 'Divi' ),
[4641] Fix | Delete
'section' => 'et_divi_buttons_hover',
[4642] Fix | Delete
'settings' => 'et_divi[all_buttons_text_color_hover]',
[4643] Fix | Delete
)
[4644] Fix | Delete
)
[4645] Fix | Delete
);
[4646] Fix | Delete
[4647] Fix | Delete
$wp_customize->add_setting(
[4648] Fix | Delete
'et_divi[all_buttons_bg_color_hover]',
[4649] Fix | Delete
array(
[4650] Fix | Delete
'default' => 'rgba(255,255,255,0.2)',
[4651] Fix | Delete
'type' => 'option',
[4652] Fix | Delete
'capability' => 'edit_theme_options',
[4653] Fix | Delete
'transport' => 'postMessage',
[4654] Fix | Delete
'sanitize_callback' => 'et_sanitize_alpha_color',
[4655] Fix | Delete
)
[4656] Fix | Delete
);
[4657] Fix | Delete
[4658] Fix | Delete
$wp_customize->add_control(
[4659] Fix | Delete
new ET_Divi_Customize_Color_Alpha_Control(
[4660] Fix | Delete
$wp_customize,
[4661] Fix | Delete
'et_divi[all_buttons_bg_color_hover]',
[4662] Fix | Delete
array(
[4663] Fix | Delete
'label' => esc_html__( 'Background Color', 'Divi' ),
[4664] Fix | Delete
'section' => 'et_divi_buttons_hover',
[4665] Fix | Delete
'settings' => 'et_divi[all_buttons_bg_color_hover]',
[4666] Fix | Delete
)
[4667] Fix | Delete
)
[4668] Fix | Delete
);
[4669] Fix | Delete
[4670] Fix | Delete
$wp_customize->add_setting(
[4671] Fix | Delete
'et_divi[all_buttons_border_color_hover]',
[4672] Fix | Delete
array(
[4673] Fix | Delete
'default' => 'rgba(0,0,0,0)',
[4674] Fix | Delete
'type' => 'option',
[4675] Fix | Delete
'capability' => 'edit_theme_options',
[4676] Fix | Delete
'transport' => 'postMessage',
[4677] Fix | Delete
'sanitize_callback' => 'et_sanitize_alpha_color',
[4678] Fix | Delete
)
[4679] Fix | Delete
);
[4680] Fix | Delete
[4681] Fix | Delete
$wp_customize->add_control(
[4682] Fix | Delete
new ET_Divi_Customize_Color_Alpha_Control(
[4683] Fix | Delete
$wp_customize,
[4684] Fix | Delete
'et_divi[all_buttons_border_color_hover]',
[4685] Fix | Delete
array(
[4686] Fix | Delete
'label' => esc_html__( 'Border Color', 'Divi' ),
[4687] Fix | Delete
'section' => 'et_divi_buttons_hover',
[4688] Fix | Delete
'settings' => 'et_divi[all_buttons_border_color_hover]',
[4689] Fix | Delete
)
[4690] Fix | Delete
)
[4691] Fix | Delete
);
[4692] Fix | Delete
[4693] Fix | Delete
$wp_customize->add_setting(
[4694] Fix | Delete
'et_divi[all_buttons_border_radius_hover]',
[4695] Fix | Delete
array(
[4696] Fix | Delete
'default' => ET_Global_Settings::get_value( 'all_buttons_border_radius_hover', 'default' ),
[4697] Fix | Delete
'type' => 'option',
[4698] Fix | Delete
'capability' => 'edit_theme_options',
[4699] Fix | Delete
'transport' => 'postMessage',
[4700] Fix | Delete
'sanitize_callback' => 'absint',
[4701] Fix | Delete
)
[4702] Fix | Delete
);
[4703] Fix | Delete
[4704] Fix | Delete
$wp_customize->add_control(
[4705] Fix | Delete
new ET_Divi_Range_Option(
[4706] Fix | Delete
$wp_customize,
[4707] Fix | Delete
'et_divi[all_buttons_border_radius_hover]',
[4708] Fix | Delete
array(
[4709] Fix | Delete
'label' => esc_html__( 'Border Radius', 'Divi' ),
[4710] Fix | Delete
'section' => 'et_divi_buttons_hover',
[4711] Fix | Delete
'type' => 'range',
[4712] Fix | Delete
'input_attrs' => array(
[4713] Fix | Delete
'min' => 0,
[4714] Fix | Delete
'max' => 50,
[4715] Fix | Delete
'step' => 1,
[4716] Fix | Delete
),
[4717] Fix | Delete
)
[4718] Fix | Delete
)
[4719] Fix | Delete
);
[4720] Fix | Delete
[4721] Fix | Delete
$wp_customize->add_setting(
[4722] Fix | Delete
'et_divi[all_buttons_spacing_hover]',
[4723] Fix | Delete
array(
[4724] Fix | Delete
'default' => ET_Global_Settings::get_value( 'all_buttons_spacing_hover', 'default' ),
[4725] Fix | Delete
'type' => 'option',
[4726] Fix | Delete
'capability' => 'edit_theme_options',
[4727] Fix | Delete
'transport' => 'postMessage',
[4728] Fix | Delete
'sanitize_callback' => 'et_sanitize_int_number',
[4729] Fix | Delete
)
[4730] Fix | Delete
);
[4731] Fix | Delete
[4732] Fix | Delete
$wp_customize->add_control(
[4733] Fix | Delete
new ET_Divi_Range_Option(
[4734] Fix | Delete
$wp_customize,
[4735] Fix | Delete
'et_divi[all_buttons_spacing_hover]',
[4736] Fix | Delete
array(
[4737] Fix | Delete
'label' => esc_html__( 'Letter Spacing', 'Divi' ),
[4738] Fix | Delete
'section' => 'et_divi_buttons_hover',
[4739] Fix | Delete
'type' => 'range',
[4740] Fix | Delete
'input_attrs' => array(
[4741] Fix | Delete
'min' => -2,
[4742] Fix | Delete
'max' => 10,
[4743] Fix | Delete
'step' => 1,
[4744] Fix | Delete
),
[4745] Fix | Delete
)
[4746] Fix | Delete
)
[4747] Fix | Delete
);
[4748] Fix | Delete
}
[4749] Fix | Delete
endif;
[4750] Fix | Delete
[4751] Fix | Delete
/**
[4752] Fix | Delete
* Add action hook to the footer in customizer preview.
[4753] Fix | Delete
*/
[4754] Fix | Delete
function et_customizer_preview_footer_action() {
[4755] Fix | Delete
if ( is_customize_preview() ) {
[4756] Fix | Delete
do_action( 'et_customizer_footer_preview' );
[4757] Fix | Delete
}
[4758] Fix | Delete
}
[4759] Fix | Delete
add_action( 'wp_footer', 'et_customizer_preview_footer_action' );
[4760] Fix | Delete
[4761] Fix | Delete
/**
[4762] Fix | Delete
* Add container with social icons to the footer in customizer preview.
[4763] Fix | Delete
* Used to get the icons and append them into the header when user enables the header social icons in customizer.
[4764] Fix | Delete
*/
[4765] Fix | Delete
function et_load_social_icons() {
[4766] Fix | Delete
$post_id = is_singular() ? get_the_ID() : 0;
[4767] Fix | Delete
$is_custom_post_type = et_builder_post_is_of_custom_post_type( $post_id );
[4768] Fix | Delete
[4769] Fix | Delete
echo '<div class="et_customizer_social_icons" style="display:none;">';
[4770] Fix | Delete
get_template_part( 'includes/social_icons', 'header' );
[4771] Fix | Delete
echo '</div>';
[4772] Fix | Delete
?>
[4773] Fix | Delete
<script type="text/javascript">
[4774] Fix | Delete
( function( $ ) {
[4775] Fix | Delete
var isCustomPostType = <?php echo json_encode( $is_custom_post_type ); ?>;
[4776] Fix | Delete
[4777] Fix | Delete
$(document).ready(function() {
[4778] Fix | Delete
$(document).trigger('et-customizer-preview-load', {
[4779] Fix | Delete
isCustomPostType: isCustomPostType,
[4780] Fix | Delete
selectorWrapper: <?php echo json_encode( ET_BUILDER_CSS_PREFIX ); ?>
[4781] Fix | Delete
});
[4782] Fix | Delete
});
[4783] Fix | Delete
}( jQuery ) );
[4784] Fix | Delete
</script>
[4785] Fix | Delete
<?php
[4786] Fix | Delete
}
[4787] Fix | Delete
add_action( 'et_customizer_footer_preview', 'et_load_social_icons' );
[4788] Fix | Delete
[4789] Fix | Delete
function et_divi_customize_preview_js() {
[4790] Fix | Delete
$theme_version = et_get_theme_version();
[4791] Fix | Delete
wp_enqueue_script( 'divi-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), $theme_version, true );
[4792] Fix | Delete
wp_localize_script( 'divi-customizer', 'et_main_customizer_data', array(
[4793] Fix | Delete
'original_footer_credits' => et_get_original_footer_credits(),
[4794] Fix | Delete
) );
[4795] Fix | Delete
}
[4796] Fix | Delete
add_action( 'customize_preview_init', 'et_divi_customize_preview_js' );
[4797] Fix | Delete
[4798] Fix | Delete
function et_divi_customize_preview_js_context() {
[4799] Fix | Delete
// Run in the wp_enqueue_scripts hook as it fires late enough that the main WP query has been resolved.
[4800] Fix | Delete
$layouts = et_theme_builder_get_template_layouts();
[4801] Fix | Delete
[4802] Fix | Delete
wp_localize_script( 'divi-customizer', 'et_theme_builder_customizer_data', array(
[4803] Fix | Delete
'hasHeaderLayout' => ! empty( $layouts ) && $layouts[ ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ]['override'],
[4804] Fix | Delete
'hasFooterLayout' => ! empty( $layouts ) && $layouts[ ET_THEME_BUILDER_FOOTER_LAYOUT_POST_TYPE ]['override'],
[4805] Fix | Delete
) );
[4806] Fix | Delete
}
[4807] Fix | Delete
add_action( 'wp_enqueue_scripts', 'et_divi_customize_preview_js_context' );
[4808] Fix | Delete
[4809] Fix | Delete
function et_divi_customize_preview_css() {
[4810] Fix | Delete
$theme_version = et_get_theme_version();
[4811] Fix | Delete
[4812] Fix | Delete
wp_enqueue_style( 'divi-customizer-controls-styles', get_template_directory_uri() . '/css/theme-customizer-controls-styles.css', array(), $theme_version );
[4813] Fix | Delete
wp_enqueue_script( 'divi-customizer-controls-js', get_template_directory_uri() . '/js/theme-customizer-controls.js', array( 'jquery' ), $theme_version, true );
[4814] Fix | Delete
wp_localize_script( 'divi-customizer-controls-js', 'et_divi_customizer_data', array(
[4815] Fix | Delete
'is_old_wp' => et_pb_is_wp_old_version() ? 'old' : 'new',
[4816] Fix | Delete
'color_palette' => implode( '|', et_pb_get_default_color_palette() ),
[4817] Fix | Delete
) );
[4818] Fix | Delete
}
[4819] Fix | Delete
add_action( 'customize_controls_enqueue_scripts', 'et_divi_customize_preview_css' );
[4820] Fix | Delete
[4821] Fix | Delete
/**
[4822] Fix | Delete
* Modifying builder options based on saved Divi values
[4823] Fix | Delete
* @param array current builder options values
[4824] Fix | Delete
* @return array modified builder options values
[4825] Fix | Delete
*/
[4826] Fix | Delete
function et_divi_builder_options( $options ) {
[4827] Fix | Delete
$options['all_buttons_icon'] = et_get_option( 'all_buttons_icon', 'yes' );
[4828] Fix | Delete
[4829] Fix | Delete
return $options;
[4830] Fix | Delete
}
[4831] Fix | Delete
add_filter( 'et_builder_options', 'et_divi_builder_options' );
[4832] Fix | Delete
[4833] Fix | Delete
/**
[4834] Fix | Delete
* Add custom customizer control
[4835] Fix | Delete
* Check for WP_Customizer_Control existence before adding custom control because WP_Customize_Control is loaded on customizer page only
[4836] Fix | Delete
*
[4837] Fix | Delete
* @see _wp_customize_include()
[4838] Fix | Delete
*/
[4839] Fix | Delete
if ( class_exists( 'WP_Customize_Control' ) ) {
[4840] Fix | Delete
[4841] Fix | Delete
/**
[4842] Fix | Delete
* Font style control for Customizer
[4843] Fix | Delete
*/
[4844] Fix | Delete
class ET_Divi_Font_Style_Option extends WP_Customize_Control {
[4845] Fix | Delete
public $type = 'font_style';
[4846] Fix | Delete
public function render_content() {
[4847] Fix | Delete
?>
[4848] Fix | Delete
<label>
[4849] Fix | Delete
<?php if ( ! empty( $this->label ) ) : ?>
[4850] Fix | Delete
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
[4851] Fix | Delete
<?php endif;
[4852] Fix | Delete
if ( ! empty( $this->description ) ) : ?>
[4853] Fix | Delete
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
[4854] Fix | Delete
<?php endif; ?>
[4855] Fix | Delete
</label>
[4856] Fix | Delete
<?php $current_values = explode('|', $this->value() );
[4857] Fix | Delete
if ( empty( $this->choices ) )
[4858] Fix | Delete
return;
[4859] Fix | Delete
foreach ( $this->choices as $value => $label ) :
[4860] Fix | Delete
$checked_class = in_array( $value, $current_values ) ? ' et_font_style_checked' : '';
[4861] Fix | Delete
?>
[4862] Fix | Delete
<span class="et_font_style et_font_value_<?php echo esc_attr( $value ); echo $checked_class; ?>">
[4863] Fix | Delete
<input type="checkbox" class="et_font_style_checkbox" value="<?php echo esc_attr( $value ); ?>" <?php checked( in_array( $value, $current_values ) ); ?> />
[4864] Fix | Delete
</span>
[4865] Fix | Delete
<?php
[4866] Fix | Delete
endforeach;
[4867] Fix | Delete
?>
[4868] Fix | Delete
<input type="hidden" class="et_font_styles" <?php $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> />
[4869] Fix | Delete
<?php
[4870] Fix | Delete
}
[4871] Fix | Delete
}
[4872] Fix | Delete
[4873] Fix | Delete
/**
[4874] Fix | Delete
* Icon picker control for Customizer
[4875] Fix | Delete
*/
[4876] Fix | Delete
class ET_Divi_Icon_Picker_Option extends WP_Customize_Control {
[4877] Fix | Delete
public $type = 'icon_picker';
[4878] Fix | Delete
[4879] Fix | Delete
public function render_content() {
[4880] Fix | Delete
[4881] Fix | Delete
?>
[4882] Fix | Delete
<label>
[4883] Fix | Delete
<?php if ( ! empty( $this->label ) ) : ?>
[4884] Fix | Delete
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
[4885] Fix | Delete
<?php endif;
[4886] Fix | Delete
et_pb_font_icon_list(); ?>
[4887] Fix | Delete
<input type="hidden" class="et_selected_icon" <?php $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> />
[4888] Fix | Delete
</label>
[4889] Fix | Delete
<?php
[4890] Fix | Delete
}
[4891] Fix | Delete
}
[4892] Fix | Delete
[4893] Fix | Delete
/**
[4894] Fix | Delete
* Range-based sliding value picker for Customizer
[4895] Fix | Delete
*/
[4896] Fix | Delete
class ET_Divi_Range_Option extends WP_Customize_Control {
[4897] Fix | Delete
public $type = 'range';
[4898] Fix | Delete
[4899] Fix | Delete
public function render_content() {
[4900] Fix | Delete
?>
[4901] Fix | Delete
<label>
[4902] Fix | Delete
<?php if ( ! empty( $this->label ) ) : ?>
[4903] Fix | Delete
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
[4904] Fix | Delete
<?php endif;
[4905] Fix | Delete
if ( ! empty( $this->description ) ) : ?>
[4906] Fix | Delete
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
[4907] Fix | Delete
<?php endif; ?>
[4908] Fix | Delete
<input type="<?php echo esc_attr( $this->type ); ?>" <?php $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); ?> data-reset_value="<?php echo esc_attr( $this->setting->default ); ?>" />
[4909] Fix | Delete
<input type="number" <?php $this->input_attrs(); ?> class="et-pb-range-input" value="<?php echo esc_attr( $this->value() ); ?>" />
[4910] Fix | Delete
<span class="et_divi_reset_slider"></span>
[4911] Fix | Delete
</label>
[4912] Fix | Delete
<?php
[4913] Fix | Delete
}
[4914] Fix | Delete
}
[4915] Fix | Delete
[4916] Fix | Delete
/**
[4917] Fix | Delete
* Custom Select option which supports data attributes for the <option> tags
[4918] Fix | Delete
*/
[4919] Fix | Delete
class ET_Divi_Select_Option extends WP_Customize_Control {
[4920] Fix | Delete
public $type = 'select';
[4921] Fix | Delete
[4922] Fix | Delete
public function render_content() {
[4923] Fix | Delete
?>
[4924] Fix | Delete
<label>
[4925] Fix | Delete
<?php if ( ! empty( $this->label ) ) : ?>
[4926] Fix | Delete
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
[4927] Fix | Delete
<?php endif;
[4928] Fix | Delete
if ( ! empty( $this->description ) ) : ?>
[4929] Fix | Delete
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
[4930] Fix | Delete
<?php endif; ?>
[4931] Fix | Delete
[4932] Fix | Delete
<select <?php $this->link(); ?>>
[4933] Fix | Delete
<?php
[4934] Fix | Delete
foreach ( $this->choices as $value => $attributes ) {
[4935] Fix | Delete
$data_output = '';
[4936] Fix | Delete
[4937] Fix | Delete
if ( ! empty( $attributes['data'] ) ) {
[4938] Fix | Delete
foreach( $attributes['data'] as $data_name => $data_value ) {
[4939] Fix | Delete
if ( '' !== $data_value ) {
[4940] Fix | Delete
$data_output .= sprintf( ' data-%1$s="%2$s"',
[4941] Fix | Delete
esc_attr( $data_name ),
[4942] Fix | Delete
esc_attr( $data_value )
[4943] Fix | Delete
);
[4944] Fix | Delete
}
[4945] Fix | Delete
}
[4946] Fix | Delete
}
[4947] Fix | Delete
[4948] Fix | Delete
echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . $data_output . '>' . esc_html( $attributes['label'] ) . '</option>';
[4949] Fix | Delete
}
[4950] Fix | Delete
?>
[4951] Fix | Delete
</select>
[4952] Fix | Delete
</label>
[4953] Fix | Delete
<?php
[4954] Fix | Delete
}
[4955] Fix | Delete
}
[4956] Fix | Delete
[4957] Fix | Delete
/**
[4958] Fix | Delete
* Color picker with alpha color support for Customizer
[4959] Fix | Delete
*/
[4960] Fix | Delete
class ET_Divi_Customize_Color_Alpha_Control extends WP_Customize_Control {
[4961] Fix | Delete
public $type = 'et_coloralpha';
[4962] Fix | Delete
[4963] Fix | Delete
public $statuses;
[4964] Fix | Delete
[4965] Fix | Delete
public function __construct( $manager, $id, $args = array() ) {
[4966] Fix | Delete
$this->statuses = array( '' => esc_html__( 'Default', 'Divi' ) );
[4967] Fix | Delete
parent::__construct( $manager, $id, $args );
[4968] Fix | Delete
[4969] Fix | Delete
// Printed saved value should always be in lowercase
[4970] Fix | Delete
add_filter( "customize_sanitize_js_{$id}", array( $this, 'sanitize_saved_value' ) );
[4971] Fix | Delete
}
[4972] Fix | Delete
[4973] Fix | Delete
public function enqueue() {
[4974] Fix | Delete
wp_enqueue_script( 'wp-color-picker-alpha' );
[4975] Fix | Delete
wp_enqueue_style( 'wp-color-picker' );
[4976] Fix | Delete
}
[4977] Fix | Delete
[4978] Fix | Delete
public function to_json() {
[4979] Fix | Delete
parent::to_json();
[4980] Fix | Delete
$this->json['statuses'] = $this->statuses;
[4981] Fix | Delete
$this->json['defaultValue'] = $this->setting->default;
[4982] Fix | Delete
}
[4983] Fix | Delete
[4984] Fix | Delete
public function render_content() {}
[4985] Fix | Delete
[4986] Fix | Delete
public function content_template() {
[4987] Fix | Delete
?>
[4988] Fix | Delete
<# var defaultValue = '';
[4989] Fix | Delete
if ( data.defaultValue ) {
[4990] Fix | Delete
if ( '#' !== data.defaultValue.substring( 0, 1 ) && 'rgba' !== data.defaultValue.substring( 0, 4 ) ) {
[4991] Fix | Delete
defaultValue = '#' + data.defaultValue;
[4992] Fix | Delete
} else {
[4993] Fix | Delete
defaultValue = data.defaultValue;
[4994] Fix | Delete
}
[4995] Fix | Delete
defaultValue = ' data-default-color=' + defaultValue; // Quotes added automatically.
[4996] Fix | Delete
} #>
[4997] Fix | Delete
<label>
[4998] Fix | Delete
<# if ( data.label ) { #>
[4999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function