add_panel( $panel_id, array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'General', 'ayyash' ),
'description' => '',
) );
// Title & Tagline Section.
$section_id = 'title_tagline';
// Change panel for Site Title & Tagline Section.
$site_title = $wp_customize->get_section( $section_id );
if ( $site_title instanceof WP_Customize_Section ) {
$site_title->panel = $panel_id;
}
// Change priority for Site Title.
$blogname = $wp_customize->get_control( 'blogname' );
if ( $blogname instanceof WP_Customize_Control ) {
$blogname->priority = 15;
}
// Change priority for Site Tagline.
$blogdescription = $wp_customize->get_control( 'blogdescription' );
if ( $blogdescription instanceof WP_Customize_Control ) {
$blogdescription->priority = 17;
}
$setting_id = $section_id . '_hide_title';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Hide Title', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'checkbox',
'priority' => 16,
)
)
);
$setting_id = $section_id . '_hide_tagline';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'absint',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Hide Tagline', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'checkbox',
'priority' => 18,
)
)
);
// Change panel for Static Front Page Section.
$front_page = $wp_customize->get_section( 'static_front_page' );
if ( $front_page instanceof WP_Customize_Section ) {
$front_page->panel = $panel_id;
}
// Logo Section.
$section_id = 'logo';
$wp_customize->add_section( $section_id,
array(
'title' => __( 'Logo', 'ayyash' ),
'priority' => 35,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id . '_logo';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Logo', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
)
)
);
$setting_id = $section_id . '_logo_retina';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Retina Logo', 'ayyash' ),
'description' => __( 'Will be visible only on devices with screen width more than 2500px', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
)
)
);
$setting_id = $section_id . '_favicon';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Favicon', 'ayyash' ),
'description' => __( '.png or .ico format. Recommended dimensions 32 x 32 pixels', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
)
)
);
$section_id = 'social_profiles';
$wp_customize->add_section( $section_id,
array(
'title' => 'Social Profiles',
'priority' => 34,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id;
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'themeoo_sanitize_social_profiles',
)
);
$wp_customize->add_control(
new Themeoo_Social_Profile_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Social Profiles', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
)
)
);
/******************************
* // Sticky Posts Section
*/
$section_id = 'sticky';
$wp_customize->add_section( $section_id,
array(
'title' => __( 'Sticky Posts', 'ayyash' ),
'priority' => 35,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id . '_label';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Sticky Label', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
)
)
);
/******************************
* // Custom Section
*/
$section_id = 'custom';
$wp_customize->add_section( $section_id,
array(
'title' => __( 'Custom', 'ayyash' ),
'priority' => 35,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id . '_css';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'wp_kses',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Custom CSS', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'textarea',
)
)
);
/******************************
* // Development Mood Section
*/
$section_id = 'devmood';
$wp_customize->add_section( $section_id,
array(
'title' => __( 'Development Mood', 'ayyash' ),
'priority' => 99,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id . '_dev_enable';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Enable Development Mood', 'ayyash' ),
'description' => __( 'If you enable development mood theme will load non-minified script and css version so you can make edit. But after completing edit when you will disable the mood you need to make sure about minifying all code manually by aditional tools can be found online.', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'checkbox',
'priority' => 16,
)
)
);
/**Enable Disable Compiler*/
$setting_id = $section_id . '_compile_enable';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Enable Compiler', 'ayyash' ),
'description' => __( 'If you want to compile', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'checkbox',
'priority' => 16,
)
)
);
/******************************
* // General Configuration Section
*/
$section_id = 's_config';
$wp_customize->add_section( $section_id,
array(
'title' => __( 'Site Configuration', 'ayyash' ),
'priority' => 99,
'capability' => 'edit_theme_options',
'panel' => $panel_id,
)
);
$setting_id = $section_id . '_lazyload_enable';
$wp_customize->add_setting(
$setting_id,
array(
'default' => themeoo_get_default( $setting_id ),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
$setting_id,
array(
'label' => __( 'Enable Lazy Loading', 'ayyash' ),
'description' => __( 'It will increase your site performence', 'ayyash' ),
'section' => $section_id,
'settings' => $setting_id,
'type' => 'checkbox',
'priority' => 16,
)
)
);
}
}