Skip to content

Instantly share code, notes, and snippets.

Created December 4, 2015 15:55
Show Gist options
  • Save anonymous/5ef69165487f4a9d7465 to your computer and use it in GitHub Desktop.
Save anonymous/5ef69165487f4a9d7465 to your computer and use it in GitHub Desktop.
<?php
// Wir lassen den User die Text und die Linkfarbe anpassen
$colors = array();
$colors[] = array(
'slug'=>'content_text_color',
'default' => '#333',
'label' => __('Content Text Color', 'Ari')
);
$colors[] = array(
'slug'=>'content_link_color',
'default' => '#88C34B',
'label' => __('Content Link Color', 'Ari')
);
foreach( $colors as $color ) {
// SETTINGS
$wp_customize->add_setting(
$color['slug'], array(
'default' => $color['default'],
'type' => 'option',
'capability' =>
'edit_theme_options'
)
);
// CONTROLS
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
$color['slug'],
array('label' => $color['label'],
'section' => 'colors',
'settings' => $color['slug'])
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment