add_section( 'recent_work_section_settings', array( 'title' => esc_html__( 'Recent Work Section', 'bizprime' ), 'priority' => 300, 'capability' => 'edit_theme_options', 'panel' => 'theme_front_page_section', ) ); // Setting - show-recent-work-section. $wp_customize->add_setting( 'theme_options[show-recent-work-section]', array( 'default' => $default['show-recent-work-section'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_checkbox', ) ); $wp_customize->add_control( 'theme_options[show-recent-work-section]', array( 'label' => esc_html__( 'Enable Recent Work', 'bizprime' ), 'section' => 'recent_work_section_settings', 'type' => 'checkbox', 'priority' => 100, ) ); // Setting - show-recent-work-section. $wp_customize->add_setting( 'theme_options[select-recent-work-main-page]', array( 'default' => $default['select-recent-work-main-page'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_dropdown_pages', ) ); $wp_customize->add_control( 'theme_options[select-recent-work-main-page]', array( 'label' => esc_html__( 'Select Main work Page', 'bizprime' ), 'section' => 'recent_work_section_settings', 'type' => 'dropdown-pages', 'priority' => 130, ) ); /*No of recent-work*/ $wp_customize->add_setting( 'theme_options[number-of-home-recent-work]', array( 'default' => $default['number-of-home-recent-work'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[number-of-home-recent-work]', array( 'label' => esc_html__( 'Select No Of Recent Work', 'bizprime' ), 'description' => __( 'After choosing "Select No Of Recent Work" option please save and publish and refresh to get actual no of field for icon and page bellow.', 'bizprime' ), 'section' => 'recent_work_section_settings', 'choices' => array( '1' => __( '1', 'bizprime' ), '2' => __( '2', 'bizprime' ), '3' => __( '3', 'bizprime' ), '4' => __( '4', 'bizprime' ), '5' => __( '5', 'bizprime' ), '6' => __( '6', 'bizprime' ), '7' => __( '7', 'bizprime' ), '8' => __( '8', 'bizprime' ), '9' => __( '9', 'bizprime' ), ), 'type' => 'select', 'priority' => 170, ) ); // Setting - select-recent-work-from. $wp_customize->add_setting( 'theme_options[select-recent-work-from]', array( 'default' => $default['select-recent-work-from'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_select', ) ); $wp_customize->add_control( 'theme_options[select-recent-work-from]', array( 'label' => esc_html__( 'Select Recent Work From', 'bizprime' ), 'section' => 'recent_work_section_settings', 'type' => 'select', 'choices' => array( 'from-page' => __( 'Page', 'bizprime' ), 'from-category' => __( 'Category', 'bizprime' ) ), 'priority' => 210, ) ); for ( $i=1; $i <= bizprime_get_option( 'number-of-home-recent-work' ) ; $i++ ) { $wp_customize->add_setting( 'theme_options[select-page-for-recent-work_'. $i .']', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'bizprime_sanitize_dropdown_pages', ) ); $wp_customize->add_control( 'theme_options[select-page-for-recent-work_'. $i .']', array( 'input_attrs' => array( 'style' => 'width: 50px;' ), 'label' => __( 'Recent Work From Page', 'bizprime' ) . ' - ' . $i , 'priority' => '120' . $i, 'section' => 'recent_work_section_settings', 'type' => 'dropdown-pages', 'priority' => 220, 'active_callback' => 'bizprime_is_select_page_recent_work', ) ); } // Setting - drop down category for recent work. $wp_customize->add_setting( 'theme_options[select-category-for-recent-work]', array( 'default' => $default['select-category-for-recent-work'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new Bizprime_Dropdown_Taxonomies_Control( $wp_customize, 'theme_options[select-category-for-recent-work]', array( 'label' => __( 'Category For Recent Work Section', 'bizprime' ), 'description' => __( 'Select category to be shown on tab ', 'bizprime' ), 'section' => 'recent_work_section_settings', 'type' => 'dropdown-taxonomies', 'taxonomy' => 'category', 'priority' => 230, 'active_callback' => 'bizprime_is_select_cat_recent_work', ) ) );