esc_attr__( 'Deactivate Animation', 'atmospheres' ),
'fadeIn' => esc_attr__( 'fadeIn', 'atmospheres' ),
'flipInX' => esc_attr__( 'flipInX', 'atmospheres' ),
'flip' => esc_attr__( 'flip', 'atmospheres' ),
'flipInY' => esc_attr__( 'flipInY', 'atmospheres' ),
'bounce' => esc_attr__( 'bounce', 'atmospheres' ),
'bounceIn' => esc_attr__( 'bounceIn', 'atmospheres' ),
'bounceInDown' => esc_attr__( 'bounceInDown', 'atmospheres' ),
'bounceInLeft' => esc_attr__( 'bounceInLeft', 'atmospheres' ),
'bounceInRight' => esc_attr__( 'bounceInRight', 'atmospheres' ),
'bounceInUp' => esc_attr__( 'bounceInUp', 'atmospheres' ),
'fadeInDownBig' => esc_attr__( 'fadeInDownBig', 'atmospheres' ),
'fadeInLeft' => esc_attr__( 'fadeInLeft', 'atmospheres' ),
'fadeInLeftBig' => esc_attr__( 'fadeInLeftBig', 'atmospheres' ),
'fadeInRight' => esc_attr__( 'fadeInRight', 'atmospheres' ),
'fadeInRightBig' => esc_attr__( 'fadeInRightBig', 'atmospheres' ),
'fadeInUp' => esc_attr__( 'fadeInUp', 'atmospheres' ),
'fadeInUpBig' => esc_attr__( 'fadeInUpBig', 'atmospheres' ),
'flash' => esc_attr__( 'flash', 'atmospheres' ),
'headShake' => esc_attr__( 'headShake', 'atmospheres' ),
'hinge' => esc_attr__( 'hinge', 'atmospheres' ),
'jello' => esc_attr__( 'jello', 'atmospheres' ),
'lightSpeedIn' => esc_attr__( 'lightSpeedIn', 'atmospheres' ),
'pulse' => esc_attr__( 'pulse', 'atmospheres' ),
'rollIn' => esc_attr__( 'rollIn', 'atmospheres' ),
'rotateIn' => esc_attr__( 'rotateIn', 'atmospheres' ),
'rotateInDownLeft' => esc_attr__( 'rotateInDownLeft', 'atmospheres' ),
'rotateInDownRight' => esc_attr__( 'rotateInDownRight', 'atmospheres' ),
'rotateInUpLeft' => esc_attr__( 'rotateInUpLeft', 'atmospheres' ),
'rotateInUpRight' => esc_attr__( 'rotateInUpRight', 'atmospheres' ),
'shake' => esc_attr__( 'shake', 'atmospheres' ),
'slideInDown' => esc_attr__( 'slideInDown', 'atmospheres' ),
'slideInLeft' => esc_attr__( 'slideInLeft', 'atmospheres' ),
'slideInRight' => esc_attr__( 'slideInRight', 'atmospheres' ),
'slideInUp' => esc_attr__( 'slideInUp', 'atmospheres' ),
'swing' => esc_attr__( 'swing', 'atmospheres' ),
'tada' => esc_attr__( 'tada', 'atmospheres' ),
'wobble' => esc_attr__( 'wobble', 'atmospheres' ),
'zoomIn' => esc_attr__( 'zoomIn', 'atmospheres' ),
'zoomInDown' => esc_attr__( 'zoomInDown', 'atmospheres' ),
'zoomInLeft' => esc_attr__( 'zoomInLeft', 'atmospheres' ),
'zoomInRight' => esc_attr__( 'zoomInRight', 'atmospheres' ),
'zoomInUp' => esc_attr__( 'zoomInUp', 'atmospheres' ),
);
return $array;
}
function atmospheres_sanitize_animations_icons( $input ) {
$valid = atmospheres_animations_icons();
if ( array_key_exists( $input, $valid ) ) {
return $input;
} else {
return '';
}
}
function atmospheres_icon_top_sanitize( $input ) {
$valid = array(
'home' => esc_attr__( 'Home Page', 'atmospheres' ),
'all' => esc_attr__( 'All Pages', 'atmospheres' ),
'deactivate' => esc_attr__( 'Deactivate', 'atmospheres' ),
);
if ( array_key_exists( $input, $valid ) ) {
return $input;
} else {
return '';
}
}
$wp_customize->add_panel( 'atmospheres_top_icons_panel' , array(
'title' => __( 'Top Icons', 'atmospheres' ),
'priority' => 7,
) );
$wp_customize->add_section( 'global_top_icons' , array(
'title' => __( 'Global Options ', 'atmospheres' ),
'panel' => 'atmospheres_top_icons_panel',
'priority' => 0,
) );
$wp_customize->add_setting( 'top_icons_show', array (
'sanitize_callback' => 'atmospheres_icon_top_sanitize',
'default' => 'deactivate'
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'top_icons_show', array(
'label' => __( 'Activate Icons', 'atmospheres' ),
'section' => 'global_top_icons',
'type' => 'select',
'priority' => 1,
'choices' => array(
'home' => esc_attr__( 'Homepage and Blog Page', 'atmospheres' ),
'all' => esc_attr__( 'All Pages', 'atmospheres' ),
'deactivate' => esc_attr__( 'Deactivate', 'atmospheres' ),
),
'default' => 'home'
) ) );
$wp_customize->add_setting( 'atmospheres_icons_margin', array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 20
) );
$wp_customize->add_control( new WP_Customize_Range_Control( $wp_customize, 'atmospheres_icons_margin', array(
'type' => 'range',
'section' => 'global_top_icons',
'label' => __( 'Margin ( top, bottom ) in /px ', 'atmospheres' ),
'input_attrs' => array(
'min' => 0,
'max' => 50,
'step' => 1,
),
) ) );
$help_1 = '
 .'/images/faq.gif)
 .'/images/1_help.webp)
';
$help_2 = ' .'/images/faq.gif)
 .'/images/2_help.webp)
';
$help_3 = ' .'/images/faq.gif)
 .'/images/3_help.webp)
';
$help_4 = ' .'/images/faq.gif)
 .'/images/3_help.webp)
How to use the icons? You can find icons here..';
/**
* Icon 1
*/
$wp_customize->add_section( 'atmospheres_icon_1' , array(
'title' => __( 'Icon 1', 'atmospheres' ),
'panel' => 'atmospheres_top_icons_panel',
'priority' => 1,
) );
$wp_customize->add_setting( 'atmospheres_icon_title_1', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Write Blog'
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_title_1', array(
'description' => sprintf( '%s', $help_1 ).__( 'Icon Title', 'atmospheres' ),
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_icon_title_1',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_description_1', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_description_1', array(
'description' => __( 'Description', 'atmospheres' ),
'description' => sprintf( '%s', $help_2 ).__(' Description', 'atmospheres' ),
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_icon_description_1',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_url_1', array (
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_url_1', array(
'description' => sprintf( '%s', $help_3 ).__( 'Icon URL', 'atmospheres' ),
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_icon_url_1',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_1', array (
'sanitize_callback' => 'wp_kses_post',
'default' => ''
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_top_icon_1', array(
'label' => __( 'Add Icon', 'atmospheres' ),
'description' => sprintf('%s', $help_4).__('%s Select icon and then copy HTML code. Put the code in the field below.', 'atmospheres' ),
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_top_icon_1',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_color_1', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_color_1', array(
'label' => __( 'Icon Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_top_icon_color_1',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_hover_color_1', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_hover_color_1', array(
'label' => __( 'Icon Hover Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_top_icon_hover_color_1',
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_1', array (
'sanitize_callback' => 'atmospheres_sanitize_animations_icons',
'default' => 'zoomInDown',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icons_animation_1', array(
'label' => __( 'Icon Animation', 'atmospheres' ),
'section' => 'atmospheres_icon_1',
'settings' => 'atmospheres_icons_animation_1',
'type' => 'select',
'choices' => atmospheres_animations_icons(),
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_speed_1', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new WP_Customize_Range_Control( $wp_customize, 'atmospheres_icons_animation_speed_1', array(
'type' => 'range',
'section' => 'atmospheres_icon_1',
'label' => __( 'Animation Speed / millisecond ', 'atmospheres' ),
'input_attrs' => array(
'min' => 0.1,
'max' => 3,
'step' => 0.1,
),
) ) );
/**
* Icon 2
*/
$wp_customize->add_section( 'atmospheres_icon_2' , array(
'title' => __( 'Icon 2', 'atmospheres' ),
'panel' => 'atmospheres_top_icons_panel',
'priority' => 1,
) );
$wp_customize->add_setting( 'atmospheres_icon_title_2', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Portfolio'
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_title_2', array(
'description' => sprintf( '%s', $help_2 ).__( 'Icon Title', 'atmospheres' ),
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_icon_title_2',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_description_2', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_description_2', array(
'description' => sprintf( '%s', $help_2 ).__(' Description', 'atmospheres' ),
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_icon_description_2',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_url_2', array (
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_url_2', array(
'description' => sprintf( '%s', $help_3 ).__( 'Icon URL', 'atmospheres' ),
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_icon_url_2',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_2', array (
'sanitize_callback' => 'wp_kses_post',
'default' => ''
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_top_icon_2', array(
'label' => __( 'Add Icon', 'atmospheres' ),
'description' => sprintf('%s', $help_4).__('%s Select icon and then copy HTML code. Put the code in the field below.', 'atmospheres' ),
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_top_icon_2',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_color_2', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_color_2', array(
'label' => __( 'Icon Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_top_icon_color_2',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_hover_color_2', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_hover_color_2', array(
'label' => __( 'Icon Hover Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_top_icon_hover_color_2',
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_2', array (
'sanitize_callback' => 'atmospheres_sanitize_animations_icons',
'default' => 'zoomInDown',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icons_animation_2', array(
'label' => __( 'Icon Animation', 'atmospheres' ),
'section' => 'atmospheres_icon_2',
'settings' => 'atmospheres_icons_animation_2',
'type' => 'select',
'choices' => atmospheres_animations_icons(),
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_speed_2', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new WP_Customize_Range_Control( $wp_customize, 'atmospheres_icons_animation_speed_2', array(
'type' => 'range',
'section' => 'atmospheres_icon_2',
'label' => __( 'Animation Speed / millisecond ', 'atmospheres' ),
'input_attrs' => array(
'min' => 0.1,
'max' => 3,
'step' => 0.1,
),
) ) );
/**
* Icon 3
*/
$wp_customize->add_section( 'atmospheres_icon_3' , array(
'title' => __( 'Icon 3', 'atmospheres' ),
'panel' => 'atmospheres_top_icons_panel',
'priority' => 1,
) );
$wp_customize->add_setting( 'atmospheres_icon_title_3', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Shop'
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_title_3', array(
'description' => sprintf( '%s', $help_3 ).__( 'Icon Title', 'atmospheres' ),
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_icon_title_3',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_description_3', array (
'sanitize_callback' => 'sanitize_text_field',
'default' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_description_3', array(
'description' => __( 'Description', 'atmospheres' ),
'description' => sprintf( '%s', $help_3 ).__(' Description', 'atmospheres' ),
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_icon_description_3',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_icon_url_3', array (
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icon_url_3', array(
'description' => sprintf( '%s', $help_3 ).__( 'Icon URL', 'atmospheres' ),
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_icon_url_3',
'type' => 'text',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_3', array (
'sanitize_callback' => 'wp_kses_post',
'default' => ''
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_top_icon_3', array(
'label' => __( 'Add Icon', 'atmospheres' ),
'description' => sprintf('%s', $help_4).__('%s Select icon and then copy HTML code. Put the code in the field below.', 'atmospheres' ),
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_top_icon_3',
'type' => 'textarea',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_color_3', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_color_3', array(
'label' => __( 'Icon Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_top_icon_color_3',
) ) );
$wp_customize->add_setting( 'atmospheres_top_icon_hover_color_3', array (
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'atmospheres_top_icon_hover_color_3', array(
'label' => __( 'Icon Hover Color', 'atmospheres' ),
'priority' => 14,
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_top_icon_hover_color_3',
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_3', array (
'sanitize_callback' => 'atmospheres_sanitize_animations_icons',
'default' => 'zoomInDown',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'atmospheres_icons_animation_3', array(
'label' => __( 'Icon Animation', 'atmospheres' ),
'section' => 'atmospheres_icon_3',
'settings' => 'atmospheres_icons_animation_3',
'type' => 'select',
'choices' => atmospheres_animations_icons(),
) ) );
$wp_customize->add_setting( 'atmospheres_icons_animation_speed_3', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new WP_Customize_Range_Control( $wp_customize, 'atmospheres_icons_animation_speed_3', array(
'type' => 'range',
'section' => 'atmospheres_icon_3',
'label' => __( 'Animation Speed / millisecond ', 'atmospheres' ),
'input_attrs' => array(
'min' => 0.1,
'max' => 3,
'step' => 0.1,
),
) ) );
}
add_action( 'customize_register', 'atmospheres_top_icons_register' );
/**
* Customize Styles
*/
function atmospheres_top_icons_method() {
$atmospheres_icons_margin = esc_html( get_theme_mod( 'atmospheres_icons_margin' ) );
$atmospheres_top_icon_color_1 = esc_html( get_theme_mod( 'atmospheres_top_icon_color_1' ) );
$atmospheres_top_icon_hover_color_1 = esc_html( get_theme_mod( 'atmospheres_top_icon_hover_color_1' ) );
if($atmospheres_icons_margin) { $margin = "
body .at-icons {
margin-top: {$atmospheres_icons_margin}px;
margin-bottom: {$atmospheres_icons_margin}px;
}
";
} else {$margin ="";}
if($atmospheres_top_icon_color_1) { $atic_style_1 = ".at-icons .tic_1 .dashicons {color: {$atmospheres_top_icon_color_1};}";} else {$atic_style_1 ="";}
if($atmospheres_top_icon_hover_color_1) { $atic_style_h_1 = ".at-icons .tic_1 .dashicons:hover {color: {$atmospheres_top_icon_hover_color_1};}";} else {$atic_style_h_1 ="";}
$atmospheres_top_icon_color_2 = esc_html( get_theme_mod( 'atmospheres_top_icon_color_2' ) );
$atmospheres_top_icon_hover_color_2 = esc_html( get_theme_mod( 'atmospheres_top_icon_hover_color_2' ) );
if($atmospheres_top_icon_color_2) { $atic_style_2 = ".at-icons .tic_2 .dashicons {color: {$atmospheres_top_icon_color_2};}";} else {$atic_style_2 ="";}
if($atmospheres_top_icon_hover_color_2) { $atic_style_h_2 = ".at-icons .tic_2 .dashicons:hover {color: {$atmospheres_top_icon_hover_color_2};}";} else {$atic_style_h_2 ="";}
$atmospheres_top_icon_color_3 = esc_html( get_theme_mod( 'atmospheres_top_icon_color_3' ) );
$atmospheres_top_icon_hover_color_3 = esc_html( get_theme_mod( 'atmospheres_top_icon_hover_color_3' ) );
if($atmospheres_top_icon_color_3) { $atic_style_3 = ".at-icons .tic_3 .dashicons {color: {$atmospheres_top_icon_color_3};}";} else {$atic_style_3 ="";}
if($atmospheres_top_icon_hover_color_3) { $atic_style_h_3 = ".at-icons .tic_3 .dashicons:hover {color: {$atmospheres_top_icon_hover_color_3};}";} else {$atic_style_h_3 ="";}
wp_add_inline_style( 'custom-style-css',
$atic_style_1.$atic_style_h_1.
$atic_style_2.$atic_style_h_2.
$atic_style_3.$atic_style_h_3.$margin
);
}
add_action( 'wp_enqueue_scripts', 'atmospheres_top_icons_method' );
/**
* Icons Action
*/
function atmospheres_top_icons_include () {
if( get_theme_mod('top_icons_show', 'deactivate') != "deactivate") {
?>