add_section( 'blogmag_editor', array( 'title' => esc_html__( 'Editor Choice', 'blogmag' ), 'panel' => 'blogoholic_home_panel', ) ); // editor enable settings $wp_customize->add_setting( 'blogmag_editor', array( 'sanitize_callback' => 'blogoholic_sanitize_select', 'default' => 'disable' ) ); $wp_customize->add_control( 'blogmag_editor', array( 'section' => 'blogmag_editor', 'label' => esc_html__( 'Content type:', 'blogmag' ), 'description' => esc_html__( 'Choose where you want to render the content from.', 'blogmag' ), 'type' => 'select', 'choices' => array( 'disable' => esc_html__( '--Disable--', 'blogmag' ), 'post' => esc_html__( 'Post', 'blogmag' ), ) ) ); $wp_customize->add_setting( 'blogmag_editor_title', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => esc_html__( 'Editors Picks', 'blogmag' ), ) ); $wp_customize->add_control( 'blogmag_editor_title', array( 'section' => 'blogmag_editor', 'label' => esc_html__( 'Section Title:', 'blogmag' ), 'active_callback' => 'blogmag_if_editor_enabled' ) ); $editor_num = 5; for ($i=1; $i <= $editor_num ; $i++) { // blog post setting $wp_customize->add_setting( 'blogmag_editor_post_'.$i, array( 'sanitize_callback' => 'blogoholic_sanitize_dropdown_pages', ) ); $wp_customize->add_control( 'blogmag_editor_post_'.$i, array( 'section' => 'blogmag_editor', 'label' => esc_html__( 'Post ', 'blogmag' ).$i, 'type' => 'select', 'choices' => blogoholic_get_post_choices(), 'active_callback' => 'blogmag_if_editor_enabled' ) ); }