Created
October 21, 2017 23:42
-
-
Save JulienMelissas/ed78c1074b9ed3f75b341760c651dcbb to your computer and use it in GitHub Desktop.
Customizer Registerer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use ClassName; | |
$panels = [ | |
'general_settings' => [ | |
'priority' => 10, | |
'title' => __('General Settings', 'label'), | |
'description' => __('General settings for this site', 'label'), | |
'sections' => [ | |
'general_colors' => [ | |
'title' => __('Colors'), | |
'description' => __('Overall site colors'), | |
'panel' => 'general', | |
'priority' => 160, | |
'capability' => 'edit_theme_options', | |
'theme_supports' => '', | |
'fields' => [ | |
'brand_primary' => [ | |
'label' => __('Brand Primary', 'label'), | |
'priority' => 10, | |
'type' => 'color', | |
'default' => '#20c1fc', | |
'variables' => [ | |
[ | |
'name' => 'brand-primary', | |
] | |
], | |
], | |
], | |
], | |
], | |
], | |
]; | |
ClassName::registerPanels($panels); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Kirki; | |
/** | |
* General Settings | |
* | |
* @type: panel | |
*/ | |
Kirki::add_panel('general', [ | |
'priority' => 10, | |
'title' => __('General Settings', 'label'), | |
'description' => __('Settings for this site', 'label'), | |
]); | |
/** | |
* Colors | |
* | |
* @type: section | |
*/ | |
Kirki::add_section('general_colors', [ | |
'title' => __('Colors'), | |
'priority' => 160, | |
'panel' => 'general', | |
'capability' => 'edit_theme_options', | |
]); | |
/** | |
* Brand Primary Color | |
* | |
* @type field | |
* @variable $brand-primary | |
*/ | |
Kirki::add_field('label_color_brand_primary', [ | |
'settings' => 'label_color_brand_primary', | |
'label' => __('Brand Primary', 'label'), | |
'section' => 'general_colors', | |
'priority' => 10, | |
'type' => 'color', | |
'default' => '#20c1fc', | |
'variables' => [ | |
[ | |
'name' => 'brand-primary', | |
] | |
], | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment