add_panel( 'theme_featured_content_panel', array( 'title' => __( 'Featured Content', 'classifyed' ), 'priority' => 100, 'capability' => 'edit_theme_options', ) ); // Featured Content Type Section. $wp_customize->add_section( 'section_theme_featured_content_type', array( 'title' => __( 'Featured Content Type', 'classifyed' ), 'priority' => 100, 'capability' => 'edit_theme_options', 'panel' => 'theme_featured_content_panel', ) ); // Setting featured_content_status. $wp_customize->add_setting( 'theme_options[featured_content_status]', array( 'default' => $default['featured_content_status'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'classifyed_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[featured_content_status]', array( 'label' => __( 'Enable Featured Content', 'classifyed' ), 'section' => 'section_theme_featured_content_type', 'type' => 'select', 'priority' => 100, 'choices' => classifyed_get_featured_content_status_options(), ) ); // Setting featured_content_number. $wp_customize->add_setting( 'theme_options[featured_content_number]', array( 'default' => $default['featured_content_number'], 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'classifyed_sanitize_number_range', ) ); $wp_customize->add_control( 'theme_options[featured_content_number]', array( 'label' => __( 'No of Blocks', 'classifyed' ), 'description' => __( 'Enter number between 1 and 20. Save and refresh the page if No is changed. ', 'classifyed' ), 'section' => 'section_theme_featured_content_type', 'type' => 'number', 'priority' => 100, 'active_callback' => 'classifyed_is_featured_content_active', 'input_attrs' => array( 'min' => 1, 'max' => 20, 'step' => 1, 'style' => 'width: 55px;' ), ) ); // Setting featured_content_column. $wp_customize->add_setting( 'theme_options[featured_content_column]', array( 'default' => $default['featured_content_column'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'classifyed_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[featured_content_column]', array( 'label' => __( 'No of Columns', 'classifyed' ), 'section' => 'section_theme_featured_content_type', 'type' => 'select', 'priority' => 100, 'choices' => classifyed_get_featured_content_column_options(), 'active_callback' => 'classifyed_is_featured_content_active', ) ); // Setting featured_content_type. $wp_customize->add_setting( 'theme_options[featured_content_type]', array( 'default' => $default['featured_content_type'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'classifyed_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[featured_content_type]', array( 'label' => __( 'Select Type', 'classifyed' ), 'section' => 'section_theme_featured_content_type', 'type' => 'select', 'priority' => 100, 'choices' => classifyed_get_featured_content_type(), 'active_callback' => 'classifyed_is_featured_content_active', ) ); $featured_content_number = absint( classifyed_get_option( 'featured_content_number' ) ); if ( $featured_content_number > 0 ) { for ( $i = 1; $i <= $featured_content_number; $i++ ) { $wp_customize->add_setting( "theme_options[featured_content_page_$i]", array( 'default' => isset( $default[ 'featured_content_page_' . $i ] ) ? $default[ 'featured_content_page_' . $i ] : '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'classifyed_sanitize_dropdown_pages', ) ); $wp_customize->add_control( "theme_options[featured_content_page_$i]", array( 'label' => __( 'Featured Page', 'classifyed' ) . ' #' . $i, 'section' => 'section_theme_featured_content_type', 'type' => 'dropdown-pages', 'priority' => 100, 'active_callback' => 'classifyed_is_featured_page_content_active', ) ); } // End for loop. } // Setting featured_content_excerpt_length. $wp_customize->add_setting( 'theme_options[featured_content_excerpt_length]', array( 'default' => $default['featured_content_excerpt_length'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'classifyed_sanitize_positive_integer', ) ); $wp_customize->add_control( 'theme_options[featured_content_excerpt_length]', array( 'label' => __( 'Content Excerpt Length', 'classifyed' ), 'section' => 'section_theme_featured_content_type', 'type' => 'number', 'priority' => 100, 'active_callback' => 'classifyed_is_featured_content_nondemo_active', 'input_attrs' => array( 'min' => 1, 'max' => 500, 'style' => 'width: 55px;' ), ) );