Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.