<?php

//Social Bar
function kindrex_socialbar( $wp_customize ) {
	$wp_customize->add_section(
		'kindrex_socialbar_section',
		array(
			'title'       => esc_html__( 'Social Bar', 'kindrex' ),
			'description' => esc_html__( 'Add Social Bar Content', 'kindrex' ),
			'priority'    => '81',
		)
	);
	
	//Social Icons
	$wp_customize->add_setting(
		'kindrex_facebook_url',
		array(
			'default'           => '/',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'kindrex_facebook_url',
		array(
			'label'       => esc_html__( 'Facebook Link:', 'kindrex' ),
			'description' => esc_html__( '--Erase the field and make blank to remove icons.', 'kindrex' ),
			'section'     => 'kindrex_socialbar_section',
			'setting'     => 'kindrex_facebook_url',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'kindrex_gplus_url',
		array(
			'default'           => '/',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'kindrex_gplus_url',
		array(
			'label'   => esc_html__( 'Google+ Link:', 'kindrex' ),
			'section' => 'kindrex_socialbar_section',
			'setting' => 'kindrex_gplus_url',
			'type'    => 'url',
		)
	);
	
	$wp_customize->add_control(
		'label-sb2',
		array(
			'type'        => 'button',
			'settings'    => array(),
			'label'       => __( 'Twitter Link:', 'kindrex' ),
			'priority'    => 10,
			'section'     => 'kindrex_socialbar_section',
			'input_attrs' => array(
				'value'   => __( 'Get pro for this feature!', 'kindrex' ),
				'class'   => 'button-secondary',
				'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
			),
		)
	);
	
	$wp_customize->add_control(
		'label-sb3',
		array(
			'type'        => 'button',
			'settings'    => array(),
			'label'       => __( 'Linkedin Link:', 'kindrex' ),
			'priority'    => 10,
			'section'     => 'kindrex_socialbar_section',
			'input_attrs' => array(
				'value'   => __( 'Get pro for this feature!', 'kindrex' ),
				'class'   => 'button-secondary',
				'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
			),
		)
	);
	
	$wp_customize->add_control(
		'label-sb4',
		array(
			'type'        => 'button',
			'settings'    => array(),
			'label'       => __( 'Instagram Link:', 'kindrex' ),
			'priority'    => 10,
			'section'     => 'kindrex_socialbar_section',
			'input_attrs' => array(
				'value'   => __( 'Get pro for this feature!', 'kindrex' ),
				'class'   => 'button-secondary',
				'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
			),
		)
	);
	
	$wp_customize->add_control(
		'label-sb5',
		array(
			'type'        => 'button',
			'settings'    => array(),
			'label'       => __( 'Youtube Link:', 'kindrex' ),
			'priority'    => 10,
			'section'     => 'kindrex_socialbar_section',
			'input_attrs' => array(
				'value'   => __( 'Get pro for this feature!', 'kindrex' ),
				'class'   => 'button-secondary',
				'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
			),
		)
	);
	
	$wp_customize->add_control(
		'label-sb6',
		array(
			'type'        => 'button',
			'settings'    => array(),
			'label'       => __( 'Discord Link:', 'kindrex' ),
			'priority'    => 10,
			'section'     => 'kindrex_socialbar_section',
			'input_attrs' => array(
				'value'   => __( 'Get pro for this feature!', 'kindrex' ),
				'class'   => 'button-secondary',
				'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
			),
		)
	);
	
}
	add_action( 'customize_register', 'kindrex_socialbar' );
