'Font Family',
'Roboto' => 'Roboto',
'Open Sans' => 'Open Sans',
'Montserrat' => 'Montserrat',
'Poppins' => 'Poppins',
);
self::$sidebar = array(
'left' => esc_html__( 'Left Sidebar', 'aldstore-dropshipping-for-aliexpress' ),
'right' => esc_html__( 'Right Sidebar', 'aldstore-dropshipping-for-aliexpress' ),
'full' => esc_html__( 'No Sidebar', 'aldstore-dropshipping-for-aliexpress' ),
);
}
public static function aldstore_dropshipping_for_aliexpress_sanitize_choices( $input, $setting ) {
$control = $setting->manager->get_control( $setting->id );
$choices = ( isset( $control->choices ) && is_array( $control->choices ) ) ? $control->choices : array();
return array_key_exists( $input, $choices ) ? $input : $setting->default;
}
public static function aldstore_dropshipping_for_aliexpress_sanitize_number_range( $number, $setting ) {
$number = floatval( $number );
$attrs = ! empty( $setting->manager->get_control( $setting->id )->input_attrs ) ? $setting->manager->get_control( $setting->id )->input_attrs : array();
$min = ! empty( $attrs['min'] ) ? $attrs['min'] : $number;
$max = ! empty( $attrs['max'] ) ? $attrs['max'] : $number;
$step = ! empty( $attrs['step'] ) ? $attrs['step'] : 1;
if ( $number < $min || $number > $max ) {
return $setting->default;
}
$number = $step ? round( $number / $step ) * $step : $number;
return round( $number, 4 );
}
public static function aldstore_dropshipping_for_aliexpress_validate_positive_integer( $validity, $value ) {
$value_check = floatval( $value );
if ( trim( $value ) != '' && ( $value_check < 0 ) ) {
$validity->add( 'out_of_range', esc_html__( 'Value must be greater than 0.', 'aldstore-dropshipping-for-aliexpress' ) );
}
return $validity;
}
public static function aldstore_dropshipping_for_aliexpress_validate_logo_width( $validity, $value ) {
$value_check = floatval( $value );
if ( trim( $value ) != '' && ( $value_check < 50 || $value_check > 200 ) ) {
$validity->add( 'out_of_range', esc_html__( 'Value must be between 50 and 200.', 'aldstore-dropshipping-for-aliexpress' ) );
}
return $validity;
}
public static function aldstore_dropshipping_for_aliexpress_validate_payment_width( $validity, $value ) {
$value_check = floatval( $value );
if ( trim( $value ) != '' && ( $value_check < 50 || $value_check > 300 ) ) {
$validity->add( 'out_of_range', esc_html__( 'Value must be between 50 and 300.', 'aldstore-dropshipping-for-aliexpress' ) );
}
return $validity;
}
public static function aldstore_dropshipping_for_aliexpress_validate_font_size( $validity, $value ) {
$value_check = floatval( $value );
if ( trim( $value ) != '' && ( $value_check < 10 || $value_check > 40 ) ) {
$validity->add( 'out_of_range', esc_html__( 'Value must be between 10 and 40.', 'aldstore-dropshipping-for-aliexpress' ) );
}
return $validity;
}
public static function aldstore_dropshipping_for_aliexpress_validate_line_height( $validity, $value ) {
$value_check = floatval( $value );
if ( trim( $value ) != '' && ( $value_check < 1 || $value_check > 3 ) ) {
$validity->add( 'out_of_range', esc_html__( 'Value must be between 1 and 3.', 'aldstore-dropshipping-for-aliexpress' ) );
}
return $validity;
}
public static function aldstore_dropshipping_for_aliexpress_customize_register( $wp_customize ) {
/**
* Section: Logo width
*/
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_header_logo_width', array(
'default' => 200,
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_logo_width' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_header_logo_width', array(
'label' => esc_html__( 'Header Logo Width (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'title_tagline',
'priority' => 8,
'type' => 'number',
'input_attrs' => array(
'min' => 50,
'max' => 200,
'step' => 1,
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_header_logo_mobile_width', array(
'default' => 100,
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_logo_width' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_header_logo_mobile_width', array(
'label' => esc_html__( 'Header Logo Mobile Width (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'title_tagline',
'priority' => 8,
'type' => 'number',
'input_attrs' => array(
'min' => 50,
'max' => 200,
'step' => 1,
),
) );
/**
* Section: Typography
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_typography_section', array(
'title' => esc_html__( 'Typography', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 39,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_body_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_body_font_family', array(
'label' => esc_html__( 'Body Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_body_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_body_font_size', array(
'label' => esc_html__( 'Body Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '16', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_body_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_body_line_height', array(
'label' => esc_html__( 'Body Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.7', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_body_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_body_color',
array(
'label' => esc_html__( 'Body Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h1
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h1_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h1_font_family', array(
'label' => esc_html__( 'H1 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h1_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h1_font_size', array(
'label' => esc_html__( 'H1 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '36', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h1_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h1_line_height', array(
'label' => esc_html__( 'H1 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h1_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h1_color',
array(
'label' => esc_html__( 'H1 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h2
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h2_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h2_font_family', array(
'label' => esc_html__( 'H2 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h2_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h2_font_size', array(
'label' => esc_html__( 'H2 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '30', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h2_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h2_line_height', array(
'label' => esc_html__( 'H2 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h2_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h2_color',
array(
'label' => esc_html__( 'H2 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h3
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h3_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h3_font_family', array(
'label' => esc_html__( 'H3 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h3_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h3_font_size', array(
'label' => esc_html__( 'H3 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '24', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h3_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h3_line_height', array(
'label' => esc_html__( 'H3 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h3_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h3_color',
array(
'label' => esc_html__( 'H3 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h4
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h4_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h4_font_family', array(
'label' => esc_html__( 'H4 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h4_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h4_font_size', array(
'label' => esc_html__( 'H4 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '20', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h4_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h4_line_height', array(
'label' => esc_html__( 'H4 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h4_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h4_color',
array(
'label' => esc_html__( 'H4 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h5
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h5_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h5_font_family', array(
'label' => esc_html__( 'H5 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h5_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h5_font_size', array(
'label' => esc_html__( 'H5 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '18', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h5_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h5_line_height', array(
'label' => esc_html__( 'H5 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h5_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h5_color',
array(
'label' => esc_html__( 'H5 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
//h6
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h6_font_family', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h6_font_family', array(
'label' => esc_html__( 'H6 Font Family', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'select',
'choices' => self::$font_family,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h6_font_size', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_font_size' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h6_font_size', array(
'label' => esc_html__( 'H6 Font Size (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 40,
'step' => 1,
'placeholder' => esc_attr__( '16', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h6_line_height', array(
'default' => '',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_line_height' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_h6_line_height', array(
'label' => esc_html__( 'H6 Line Height', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
'type' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 3,
'step' => 0.1,
'placeholder' => esc_attr__( '1.25', 'aldstore-dropshipping-for-aliexpress' ),
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_h6_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color'
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_h6_color',
array(
'label' => esc_html__( 'H6 Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_typography_section',
)
) );
/**
* Section: Colors
*/
$wp_customize->add_setting(
'aldstore_dropshipping_for_aliexpress_primary_color',
array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_primary_color',
array(
'label' => esc_html__( 'Primary Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'colors',
'settings' => 'aldstore_dropshipping_for_aliexpress_primary_color',
)
)
);
$wp_customize->add_setting(
'aldstore_dropshipping_for_aliexpress_secondary_color',
array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_secondary_color',
array(
'label' => esc_html__( 'Secondary Color', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'colors',
'settings' => 'aldstore_dropshipping_for_aliexpress_secondary_color',
)
)
);
/**
* Section: Social
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_social_section', array(
'title' => esc_html__( 'Social', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 41,
) );
$socials = array(
'facebook' => array(
'label' => esc_html__( 'Facebook URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
'instagram' => array(
'label' => esc_html__( 'Instagram URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
'pinterest' => array(
'label' => esc_html__( 'Pinterest URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
'youtube' => array(
'label' => esc_html__( 'YouTube URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
'linkedin' => array(
'label' => esc_html__( 'LinkedIn URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
'twitter' => array(
'label' => esc_html__( 'Twitter URL', 'aldstore-dropshipping-for-aliexpress' ),
'default' => '',
),
);
foreach ( $socials as $network => $args ) {
$wp_customize->add_setting( "{$network}_link", array(
'default' => $args['default'],
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( "{$network}_link", array(
'label' => esc_html( $args['label'] ),
'section' => 'aldstore_dropshipping_for_aliexpress_social_section',
'type' => 'url',
) );
}
/**
* Section: Header
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_header_section', array(
'title' => esc_html__( 'Header', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 41,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_header_contact_title', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_header_contact_title', array(
'label' => esc_html__( 'Contact Title', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_header_section',
'type' => 'text',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_header_contact_phone', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_header_contact_phone', array(
'label' => esc_html__( 'Contact Phone Number', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_header_section',
'type' => 'text',
) );
/**
* Section: Footer
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_footer_section', array(
'title' => esc_html__( 'Footer', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 41,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_logo', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_footer_logo',
array(
'label' => esc_html__( 'Logo', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'settings' => 'aldstore_dropshipping_for_aliexpress_footer_logo',
)
)
);
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_logo_width', array(
'default' => 200,
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_logo_width' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_footer_logo_width', array(
'label' => esc_html__( 'Logo Width (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'number',
'input_attrs' => array(
'min' => 50,
'max' => 200,
'step' => 1,
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_logo_mobile_width', array(
'default' => 100,
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_logo_width' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_footer_logo_mobile_width', array(
'label' => esc_html__( 'Logo Mobile Width (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'number',
'input_attrs' => array(
'min' => 50,
'max' => 200,
'step' => 1,
),
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_slogan', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_footer_slogan', array(
'label' => esc_html__( 'Slogan', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'text',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_footer_social', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_footer_social', array(
'label' => esc_html__( 'Enable Footer Social', 'aldstore-dropshipping-for-aliexpress' ),
'description' => wp_kses_post(
sprintf(
__( 'You can edit social links here.', 'aldstore-dropshipping-for-aliexpress' ),
admin_url( 'customize.php?autofocus[section]=social_section' )
)
),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'checkbox',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_copyright', array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_footer_copyright', array(
'label' => esc_html__( 'Copyright', 'aldstore-dropshipping-for-aliexpress' ),
'description' => wp_kses_post(
sprintf(
__( '{current_year}: Current Year (%1$s)
{site_title}: Site Title (%2$s)', 'aldstore-dropshipping-for-aliexpress' ),
date( 'Y' ),
get_bloginfo( 'name' )
)
),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'textarea',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_payment', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_footer_payment',
array(
'label' => esc_html__( 'Payment', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'settings' => 'aldstore_dropshipping_for_aliexpress_footer_payment',
)
)
);
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_footer_payment_width', array(
'default' => 280,
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_number_range' ),
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_payment_width' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_footer_payment_width', array(
'label' => esc_html__( 'Payment Width (Unit px)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_footer_section',
'type' => 'number',
'input_attrs' => array(
'min' => 50,
'max' => 300,
'step' => 1,
),
) );
/**
* Panel: Blog
*/
$wp_customize->add_panel( 'aldstore_dropshipping_for_aliexpress_blog_panel', array(
'title' => esc_html__( 'Blog/Post', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 42,
) );
/**
* Section: Blog
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_blog_section', array(
'title' => esc_html__( 'Blog', 'aldstore-dropshipping-for-aliexpress' ),
'panel' => 'aldstore_dropshipping_for_aliexpress_blog_panel',
'priority' => 42,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_blog_sidebar_layout', array(
'default' => 'left',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_blog_sidebar_layout', array(
'label' => esc_html__( 'Blog Sidebar Layout', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_blog_section',
'type' => 'radio',
'choices' => self::$sidebar,
) );
/**
* Section: Post
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_post_section', array(
'title' => esc_html__( 'Post', 'aldstore-dropshipping-for-aliexpress' ),
'panel' => 'aldstore_dropshipping_for_aliexpress_blog_panel',
'priority' => 42,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_post_shares', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_post_shares', array(
'label' => esc_html__( 'Enable Post Shares', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_post_section',
'type' => 'checkbox',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_post_sidebar_layout', array(
'default' => 'left',
'sanitize_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_sanitize_choices' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_post_sidebar_layout', array(
'label' => esc_html__( 'Post Sidebar Layout', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_post_section',
'type' => 'radio',
'choices' => self::$sidebar,
) );
/**
* Panel: Shop
*/
$wp_customize->add_panel( 'aldstore_dropshipping_for_aliexpress_shop_panel', array(
'title' => esc_html__( 'Shop/Product', 'aldstore-dropshipping-for-aliexpress' ),
'priority' => 42,
) );
/**
* Section: Shop
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_shop_section', array(
'title' => esc_html__( 'Shop', 'aldstore-dropshipping-for-aliexpress' ),
'panel' => 'aldstore_dropshipping_for_aliexpress_shop_panel',
'priority' => 42,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_product_newness', array(
'default' => 10,
'sanitize_callback' => function ( $value ) {
return absint( $value );
},
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_positive_integer' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_product_newness', array(
'label' => esc_html__( 'Products Newness (Days)', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_shop_section',
'type' => 'number',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_product_per_page', array(
'default' => 12,
'sanitize_callback' => function ( $value ) {
return absint( $value );
},
'validate_callback' => array( __CLASS__, 'aldstore_dropshipping_for_aliexpress_validate_positive_integer' ),
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_product_per_page', array(
'label' => esc_html__( 'Number Of Products On Shop Page ', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_shop_section',
'type' => 'number',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_shop_fullwidth', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_shop_fullwidth', array(
'label' => esc_html__( 'Enable Shop Fullwidth', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_shop_section',
'type' => 'checkbox',
) );
/**
* Section: Product
*/
$wp_customize->add_section( 'aldstore_dropshipping_for_aliexpress_product_section', array(
'title' => esc_html__( 'Product', 'aldstore-dropshipping-for-aliexpress' ),
'panel' => 'aldstore_dropshipping_for_aliexpress_shop_panel',
'priority' => 42,
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_product_viewing', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_product_viewing', array(
'label' => esc_html__( 'Enable Product Viewing', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_product_section',
'type' => 'checkbox',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_product_shares', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_product_shares', array(
'label' => esc_html__( 'Enable Product Shares', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_product_section',
'type' => 'checkbox',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_enable_product_fullwidth', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'aldstore_dropshipping_for_aliexpress_enable_product_fullwidth', array(
'label' => esc_html__( 'Enable Product Fullwidth', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_product_section',
'type' => 'checkbox',
) );
$wp_customize->add_setting( 'aldstore_dropshipping_for_aliexpress_product_payment', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'aldstore_dropshipping_for_aliexpress_product_payment',
array(
'label' => esc_html__( 'Payment', 'aldstore-dropshipping-for-aliexpress' ),
'section' => 'aldstore_dropshipping_for_aliexpress_product_section',
'settings' => 'aldstore_dropshipping_for_aliexpress_product_payment',
)
)
);
if ( isset( $wp_customize->selective_refresh ) ) {
$wp_customize->selective_refresh->add_partial( 'custom_logo', array(
'selector' => 'header .header-logo',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_header_contact_title', array(
'selector' => 'header .header-about-inner:first-child .header-about-title',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_footer_logo', array(
'selector' => 'footer .footer-logo',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_footer_slogan', array(
'selector' => 'footer .footer-slogan',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_enable_footer_social', array(
'selector' => 'footer .social-link',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_footer_copyright', array(
'selector' => 'footer .footer-copyright',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_footer_payment', array(
'selector' => 'footer .footer-payment',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_enable_product_shares', array(
'selector' => '.product-share-button',
) );
$wp_customize->selective_refresh->add_partial( 'aldstore_dropshipping_for_aliexpress_enable_post_shares', array(
'selector' => '.post-footer .aldstore-share-button',
) );
}
}
}
}