<?php
/**
* Share Button options
*
* @package FreshWP WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/

function freshwp_share_buttons_options($wp_customize) {

    $wp_customize->add_section( 'freshwp_section_share', array( 'title' => esc_html__( 'Share Buttons', 'freshwp' ), 'panel' => 'freshwp_main_options_panel', 'priority' => 420 ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_buttons]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_buttons_control', array( 'label' => esc_html__( 'Hide Share Buttons from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_buttons]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_text]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_text_control', array( 'label' => esc_html__( 'Hide Share Text from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_text]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'freshwp_options[share_text]', array( 'default' => esc_html__( 'Share:', 'freshwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) );

    $wp_customize->add_control( 'freshwp_share_text_control', array( 'label' => esc_html__( 'Share Text for Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[share_text]', 'type' => 'text', ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_twitter]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_twitter_control', array( 'label' => esc_html__( 'Hide Twitter Share Button from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_twitter]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_facebook]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_facebook_control', array( 'label' => esc_html__( 'Hide Facebook Share Button from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_facebook]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_pinterest]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_pinterest_control', array( 'label' => esc_html__( 'Hide Pinterest Share Button from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_pinterest]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'freshwp_options[hide_share_linkedin]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'freshwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'freshwp_hide_share_linkedin_control', array( 'label' => esc_html__( 'Hide Linkedin Share Button from Single Posts', 'freshwp' ), 'section' => 'freshwp_section_share', 'settings' => 'freshwp_options[hide_share_linkedin]', 'type' => 'checkbox', ) );

}