Skip to content

Instantly share code, notes, and snippets.

@holisticnetworking
Last active July 8, 2017 03:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holisticnetworking/000bbb338ed695b4ee19 to your computer and use it in GitHub Desktop.
Save holisticnetworking/000bbb338ed695b4ee19 to your computer and use it in GitHub Desktop.
Iterating over several related theme mods to create both their settings and their controls.
// Icon Fonts:
foreach( ReactiveCustomizer::$icon_fonts as $slug=>$name ) :
$wp_customize->add_setting( 'hn_icon_fonts_' . $slug , array(
'default' => '0'
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'icon_fonts_' . $slug, array(
'label' => __( $name, 'hn-reactive' ),
'section' => 'icon_fonts',
'settings' => 'hn_icon_fonts_' . $slug,
'type' => 'checkbox'
) ) );
endforeach;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment