'entire-site', // Breadcrumb 'alpert_breadcrumb_show' => 1, // Layout Options. 'alpert_layout_type' => 'fluid', 'alpert_default_layout' => 'right-sidebar', 'alpert_homepage_archive_layout' => 'no-sidebar-full-width', // Excerpt Options 'alpert_excerpt_length' => 30, 'alpert_excerpt_more_text' => esc_html__( 'Continue reading', 'alpert' ), // Homepage/Frontpage Options. 'alpert_front_page_category' => '', // Search Options. 'alpert_search_text' => esc_html__( 'Search...', 'alpert' ), ); $updated_defaults = wp_parse_args( $defaults, $default_options ); return $updated_defaults; } /** * Register the Customizer panels */ public function add_panel( $wp_customize ) { /** * Add our Header & Navigation Panel */ $wp_customize->add_panel( 'alpert_theme_options', array( 'title' => esc_html__( 'Theme Options', 'alpert' ), ) ); } /** * Add breadcrumb section and its controls */ public function register_breadcrumb_options( $wp_customize ) { // Add Excerpt Options section. $wp_customize->add_section( 'alpert_breadcrumb_options', array( 'title' => esc_html__( 'Breadcrumb', 'alpert' ), 'panel' => 'alpert_theme_options', ) ); if ( function_exists( 'bcn_display' ) ) { Alpert_Customizer_Utilities::register_option( array( 'custom_control' => 'Alpert_Simple_Notice_Custom_Control', 'sanitize_callback' => 'sanitize_text_field', 'settings' => 'ff_multiputpose_breadcrumb_plugin_notice', 'label' => esc_html__( 'Info', 'alpert' ), 'description' => sprintf( esc_html__( 'Since Breadcrumb NavXT Plugin is installed, edit plugin\'s settings %1$shere%2$s', 'alpert' ), '', '' ), 'section' => 'ff_multiputpose_breadcrumb_options', ) ); return; } Alpert_Customizer_Utilities::register_option( array( 'custom_control' => 'Alpert_Toggle_Switch_Custom_control', 'settings' => 'alpert_breadcrumb_show', 'sanitize_callback' => 'alpert_switch_sanitization', 'label' => esc_html__( 'Display Breadcrumb?', 'alpert' ), 'section' => 'alpert_breadcrumb_options', ) ); } /** * Add layouts section and its controls */ public function register_layout_options( $wp_customize ) { // Add layouts section. $wp_customize->add_section( 'alpert_layouts', array( 'title' => esc_html__( 'Layouts', 'alpert' ), 'panel' => 'alpert_theme_options' ) ); Alpert_Customizer_Utilities::register_option( array( 'type' => 'select', 'settings' => 'alpert_layout_type', 'sanitize_callback' => 'alpert_sanitize_select', 'label' => esc_html__( 'Site Layout', 'alpert' ), 'section' => 'alpert_layouts', 'choices' => array( 'fluid' => esc_html__( 'Fluid', 'alpert' ), 'boxed' => esc_html__( 'Boxed', 'alpert' ), ), ) ); Alpert_Customizer_Utilities::register_option( array( 'type' => 'select', 'settings' => 'alpert_default_layout', 'sanitize_callback' => 'alpert_sanitize_select', 'label' => esc_html__( 'Default Layout', 'alpert' ), 'section' => 'alpert_layouts', 'choices' => array( 'right-sidebar' => esc_html__( 'Right Sidebar', 'alpert' ), 'no-sidebar-full-width' => esc_html__( 'No Sidebar: Full Width', 'alpert' ), ), ) ); Alpert_Customizer_Utilities::register_option( array( 'type' => 'select', 'settings' => 'alpert_homepage_archive_layout', 'sanitize_callback' => 'alpert_sanitize_select', 'label' => esc_html__( 'Homepage/Archive Layout', 'alpert' ), 'section' => 'alpert_layouts', 'choices' => array( 'right-sidebar' => esc_html__( 'Right Sidebar', 'alpert' ), 'no-sidebar-full-width' => esc_html__( 'No Sidebar: Full Width', 'alpert' ), ), ) ); } /** * Add excerpt section and its controls */ public function register_excerpt_options( $wp_customize ) { // Add Excerpt Options section. $wp_customize->add_section( 'alpert_excerpt_options', array( 'title' => esc_html__( 'Excerpt Options', 'alpert' ), 'panel' => 'alpert_theme_options', ) ); Alpert_Customizer_Utilities::register_option( array( 'type' => 'number', 'settings' => 'alpert_excerpt_length', 'sanitize_callback' => 'absint', 'label' => esc_html__( 'Excerpt Length (Words)', 'alpert' ), 'section' => 'alpert_excerpt_options', ) ); Alpert_Customizer_Utilities::register_option( array( 'type' => 'text', 'settings' => 'alpert_excerpt_more_text', 'sanitize_callback' => 'sanitize_text_field', 'label' => esc_html__( 'Excerpt More Text', 'alpert' ), 'section' => 'alpert_excerpt_options', ) ); } /** * Add Homepage/Frontpage section and its controls */ public function register_homepage_options( $wp_customize ) { Alpert_Customizer_Utilities::register_option( array( 'custom_control' => 'Alpert_Dropdown_Select2_Custom_Control', 'sanitize_callback' => 'alpert_text_sanitization', 'settings' => 'alpert_front_page_category', 'description' => esc_html__( 'Filter Homepage/Blog page posts by following categories', 'alpert' ), 'label' => esc_html__( 'Categories', 'alpert' ), 'section' => 'static_front_page', 'input_attrs' => array( 'multiselect' => true, ), 'choices' => array( esc_html__( '--Select--', 'alpert' ) => Alpert_Customizer_Utilities::get_terms( 'category' ) ), ) ); } /** * Add Homepage/Frontpage section and its controls */ public function register_search_options( $wp_customize ) { // Add Homepage/Frontpage Section. $wp_customize->add_section( 'alpert_search', array( 'title' => esc_html__( 'Search', 'alpert' ), 'panel' => 'alpert_theme_options', ) ); Alpert_Customizer_Utilities::register_option( array( 'settings' => 'alpert_search_text', 'sanitize_callback' => 'alpert_text_sanitization', 'label' => esc_html__( 'Search Text', 'alpert' ), 'section' => 'alpert_search', 'type' => 'text', ) ); } } /** * Initialize class */ $alpert_theme_options = new Alpert_Theme_Options();