style="float: none;" class="fa-icons"> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href=""> " href="">
esc_attr__( ' ', 'baw' ), '_self' => esc_attr__( 'Self', 'baw' ), '_blank' => esc_attr__( 'Blank', 'baw' ), ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } } function baw_customize_register_social( $wp_customize ) { $wp_customize->add_section( 'baw_social_section' , array( 'title' => __( 'Social Media', 'baw' ), 'description' => __( 'Social media buttons', 'baw' ), 'priority' => 64, ) ); $wp_customize->add_setting( 'social_media_activate', array ( 'default' => '', 'sanitize_callback' => 'baw_sanitize_checkbox', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_media_activate', array( 'label' => __( 'Activate Social Icons in Footer', 'baw' ), 'section' => 'baw_social_section', 'type' => 'checkbox', ) ) ); $wp_customize->add_setting( 'baw_social_link_type', array ( 'sanitize_callback' => 'sanitize_social', 'default' => 'no', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_social_link_type', array( 'label' => __( 'Link Type', 'baw' ), 'section' => 'baw_social_section', 'type' => 'select', 'priority' => 10, 'choices' => array( '' => esc_attr__( ' ', 'baw' ), '_self' => esc_attr__( 'Self', 'baw' ), '_blank' => esc_attr__( 'Blank', 'baw' ), ), ) ) ); $wp_customize->add_setting( 'social_media_color', array ( 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'social_media_color', array( 'label' => __( 'Social Icons Color', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'social_media_hover_color', array ( 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'social_media_hover_color', array( 'label' => __( 'Social Icons Hover Color', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_facebook', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_facebook', array( 'label' => __( 'Enter Facebook url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_twitter', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_twitter', array( 'label' => __( 'Enter Twitter url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_linkedin', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_linkedin', array( 'label' => __( 'Enter Linkedin url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_rss', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_rss', array( 'label' => __( 'Enter RSS url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_pinterest', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_pinterest', array( 'label' => __( 'Enter Pinterest url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_youtube', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_youtube', array( 'label' => __( 'Enter Youtube url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_vimeo', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_vimeo', array( 'label' => __( 'Enter Vimeo url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_instagram', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_instagram', array( 'label' => __( 'Enter Ynstagram url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_stumbleupon', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_stumbleupon', array( 'label' => __( 'Enter Stumbleupon url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_flickr', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_flickr', array( 'label' => __( 'Enter Flickr url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_dribbble', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_dribbble', array( 'label' => __( 'Enter Dribbble url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_digg', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_digg', array( 'label' => __( 'Enter Digg url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_skype', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_skype', array( 'label' => __( 'Enter Skype url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_deviantart', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_deviantart', array( 'label' => __( 'Enter Deviantart url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_yahoo', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_yahoo', array( 'label' => __( 'Enter Yahoo url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_reddit_alien', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_reddit_alien', array( 'label' => __( 'Enter Reddit Alien url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_paypal', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_paypal', array( 'label' => __( 'Enter Paypal url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_dropbox', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_dropbox', array( 'label' => __( 'Enter Dropbox url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'Soundcloud', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'Soundcloud', array( 'label' => __( 'Enter Soundcloud url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_vk', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_vk', array( 'label' => __( 'Enter VK url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_envelope', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_envelope', array( 'label' => __( 'Enter Envelope url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_book', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_book', array( 'label' => __( 'Enter Address Book url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_apple', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_apple', array( 'label' => __( 'Enter Apple url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_amazon', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_amazon', array( 'label' => __( 'Enter Amazon url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_slack', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_slack', array( 'label' => __( 'Enter Slack url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_slideshare', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_slideshare', array( 'label' => __( 'Enter Slideshare url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_wikipedia', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_wikipedia', array( 'label' => __( 'Enter Wikipedia url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_wordpress', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_wordpress', array( 'label' => __( 'Enter WordPress url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_odnoklassniki', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_odnoklassniki', array( 'label' => __( 'Enter Odnoklassniki url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_tumblr', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_tumblr', array( 'label' => __( 'Enter Tumblr url', 'baw' ), 'section' => 'baw_social_section', ) ) ); $wp_customize->add_setting( 'baw_address_github', array ( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'baw_address_github', array( 'label' => __( 'Enter GitHub url', 'baw' ), 'section' => 'baw_social_section', ) ) ); } add_action( 'customize_register', 'baw_customize_register_social' ); /******************************************** * Social styles *********************************************/ function baw_social_method() { $social_media_color_mod = get_theme_mod( 'social_media_color' ); $social_media_hover_color_mod = get_theme_mod( 'social_media_hover_color' ); if($social_media_color_mod) { $social_media_color = ".social .fa-icons i, .social-top .fa {color: {$social_media_color_mod} !important;}";} else {$social_media_color ="";} if($social_media_hover_color_mod) { $social_media_hover_color = ".social .fa-icons i:hover, .social-top a:hover .fa {color: {$social_media_hover_color_mod} !important;}";} else {$social_media_hover_color ="";} wp_add_inline_style( 'black-and-white-style', $social_media_color.$social_media_hover_color); } add_action( 'wp_enqueue_scripts', 'baw_social_method' );