// Additional social links. for ( $i = 6; $i <= 10; $i++ ) { CSCO_Customizer::add_field( array( 'type' => 'checkbox', 'settings' => "misc_social_{$i}", 'label' => sprintf( esc_html__( 'Display Social Link %d', 'newsreader' ), $i ), 'section' => 'miscellaneous', 'default' => false, ) ); CSCO_Customizer::add_field( array( 'type' => 'text', 'settings' => "misc_social_{$i}_label", 'label' => sprintf( esc_html__( 'Social %d Label', 'newsreader' ), $i ), 'section' => 'miscellaneous', 'default' => '', 'active_callback' => array( array( 'setting' => "misc_social_{$i}", 'operator' => '==', 'value' => true, ), ), ) ); CSCO_Customizer::add_field( array( 'type' => 'text', 'settings' => "misc_social_{$i}_link", 'label' => sprintf( esc_html__( 'Social %d Link', 'newsreader' ), $i ), 'section' => 'miscellaneous', 'default' => '', 'active_callback' => array( array( 'setting' => "misc_social_{$i}", 'operator' => '==', 'value' => true, ), ), ) ); // Icon type toggle: image upload or SVG code. CSCO_Customizer::add_field( array( 'type' => 'radio', 'settings' => "misc_social_{$i}_icon_type", 'label' => sprintf( esc_html__( 'Social %d Icon Type', 'newsreader' ), $i ), 'section' => 'miscellaneous', 'default' => 'image', 'choices' => array( 'image' => esc_html__( 'Image Upload', 'newsreader' ), 'svg' => esc_html__( 'SVG Code', 'newsreader' ), ), 'active_callback' => array( array( 'setting' => "misc_social_{$i}", 'operator' => '==', 'value' => true, ), ), ) ); // Image upload field (shown when icon type = image). CSCO_Customizer::add_field( array( 'type' => 'image', 'settings' => "misc_social_{$i}_icon", 'label' => sprintf( esc_html__( 'Social %d Icon', 'newsreader' ), $i ), 'description' => esc_html__( 'Please upload the 2x version of your icon via Media Library with @2x suffix for Retina screens support. Recommended width and height is 26px (52px for Retina version).', 'newsreader' ), 'section' => 'miscellaneous', 'default' => '', 'active_callback' => array( array( 'setting' => "misc_social_{$i}", 'operator' => '==', 'value' => true, ), array( 'setting' => "misc_social_{$i}_icon_type", 'operator' => '==', 'value' => 'image', ), ), ) ); // SVG code textarea (shown when icon type = svg). CSCO_Customizer::add_field( array( 'type' => 'textarea', 'settings' => "misc_social_{$i}_icon_svg", 'label' => sprintf( esc_html__( 'Social %d SVG Code', 'newsreader' ), $i ), 'description' => esc_html__( 'Paste your SVG code here. Example: . Recommended size: 25x25px.', 'newsreader' ), 'section' => 'miscellaneous', 'default' => '', 'active_callback' => array( array( 'setting' => "misc_social_{$i}", 'operator' => '==', 'value' => true, ), array( 'setting' => "misc_social_{$i}_icon_type", 'operator' => '==', 'value' => 'svg', ), ), ) ); }