113 lines
3.4 KiB
PHP
113 lines
3.4 KiB
PHP
<?php
|
|
/**
|
|
* Sophia After Dark manage the Customizer options of additional panel.
|
|
*
|
|
* @package Sophia After Dark
|
|
* @since 1.0.0
|
|
*/
|
|
add_action( 'customize_register', 'sophia_after_dark_customize_additinal_panels_sections_register' );
|
|
/**
|
|
* Add Additional panels in the theme customize
|
|
*
|
|
*/
|
|
function sophia_after_dark_customize_additinal_panels_sections_register( $wp_customize ) {
|
|
|
|
/*------------------------------------------------ Social Icons Section ------------------------------------------------*/
|
|
/**
|
|
* Social Icons
|
|
*/
|
|
$wp_customize->add_section( 'sophia_after_dark_section_social_icons',
|
|
array(
|
|
'title' => esc_html__( 'Social Icons', 'sophia-after-dark' ),
|
|
'panel' => 'sophia_after_dark_additional_panel',
|
|
'capability' => 'edit_theme_options',
|
|
'priority' => 5,
|
|
'theme_supports' => '',
|
|
)
|
|
);
|
|
|
|
/**
|
|
* Repeater field for social icons
|
|
*/
|
|
$wp_customize->add_setting(
|
|
'sophia_after_dark_social_icons',
|
|
array(
|
|
'capability' => 'edit_theme_options',
|
|
'default' => json_encode( array(
|
|
array(
|
|
'social_icon' => 'fa fa-twitter',
|
|
'social_url' => '#',
|
|
),
|
|
array(
|
|
'social_icon' => 'fa fa-pinterest',
|
|
'social_url' => '#',
|
|
)
|
|
)
|
|
),
|
|
'sanitize_callback' => 'wp_kses_post'
|
|
)
|
|
);
|
|
$wp_customize->add_control( new Sophia_After_Dark_Control_Repeater(
|
|
$wp_customize,
|
|
'sophia_after_dark_social_icons',
|
|
array(
|
|
'label' => __( 'Social Media', 'sophia-after-dark' ),
|
|
'section' => 'sophia_after_dark_section_social_icons',
|
|
'settings' => 'sophia_after_dark_social_icons',
|
|
'priority' => 5,
|
|
'sophia_after_dark_box_label_text' => __( 'Social Media Icons','sophia-after-dark' ),
|
|
'sophia_after_dark_box_add_control_text' => __( 'Add Icon','sophia-after-dark' )
|
|
),
|
|
array(
|
|
'social_icon' => array(
|
|
'type' => 'social_icon',
|
|
'label' => esc_html__( 'Social Icon', 'sophia-after-dark' ),
|
|
'description' => __( 'Choose social media icon.', 'sophia-after-dark' )
|
|
),
|
|
'social_url' => array(
|
|
'type' => 'url',
|
|
'label' => esc_html__( 'Social Link URL', 'sophia-after-dark' ),
|
|
'description' => __( 'Enter social media url.', 'sophia-after-dark' )
|
|
),
|
|
)
|
|
)
|
|
);
|
|
|
|
/*------------------------------------------------ Breadcrumbs Section ------------------------------------------------*
|
|
/**
|
|
* Breadcrumbs
|
|
*/
|
|
$wp_customize->add_section( 'sophia_after_dark_section_breadcrumbs',
|
|
array(
|
|
'title' => esc_html__( 'Breadcrumbs', 'sophia-after-dark' ),
|
|
'panel' => 'sophia_after_dark_additional_panel',
|
|
'capability' => 'edit_theme_options',
|
|
'priority' => 10,
|
|
'theme_supports' => '',
|
|
)
|
|
);
|
|
|
|
/**
|
|
* Toggle field for Enable/Disable breadcrumbs.
|
|
*
|
|
*/
|
|
$wp_customize->add_setting( 'sophia_after_dark_enable_breadcrumb_option',
|
|
array(
|
|
'capability' => 'edit_theme_options',
|
|
'default' => true,
|
|
'sanitize_callback' => 'sophia_after_dark_sanitize_checkbox'
|
|
)
|
|
);
|
|
|
|
$wp_customize->add_control( new Sophia_After_Dark_Control_Toggle(
|
|
$wp_customize, 'sophia_after_dark_enable_breadcrumb_option',
|
|
array(
|
|
'label' => __( 'Enable Breadcrumbs', 'sophia-after-dark' ),
|
|
'section' => 'sophia_after_dark_section_breadcrumbs',
|
|
'settings' => 'sophia_after_dark_enable_breadcrumb_option',
|
|
'priority' => 5,
|
|
)
|
|
)
|
|
);
|
|
|
|
} |