本文整理汇总了PHP中Kirki::add_section方法的典型用法代码示例。如果您正苦于以下问题:PHP Kirki::add_section方法的具体用法?PHP Kirki::add_section怎么用?PHP Kirki::add_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kirki
的用法示例。
在下文中一共展示了Kirki::add_section方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/*******************************
* FEATURED IMAGES
******************************/
Kirki::add_section('featured_images', array('title' => __('Featured Images', 'daphnee'), 'priority' => 90));
$post_types = array();
$post_types_objects = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects', 'and');
foreach ($post_types_objects as $post_type) {
$post_types[$post_type->name] = $post_type->labels->name;
}
// Remove attachment post type
$post_types = array_diff($post_types, array('attachment' => 'Media'));
Kirki::add_field('daphnee', array('type' => 'multicheck', 'label' => __('Enable featured images per post-type', 'daphnee'), 'section' => 'featured_images', 'settings' => 'featured_image_post_types', 'description' => __('Please note that featured images will only be shown if the post type supports them and the post has a featured image.', 'daphnee'), 'default' => array('post'), 'choices' => $post_types));
/*******************************
* SOCIAL LINKS
******************************/
Kirki::add_section('social_links', array('title' => __('Social Links', 'daphnee'), 'priority' => 100));
Kirki::add_field('', array('label' => __('Social Links', 'kirki'), 'settings' => 'social_links', 'type' => 'repeater', 'section' => 'social_links', 'default' => array(), 'fields' => array('label' => array('type' => 'select', 'label' => 'Social Network', 'default' => '', 'choices' => array('' => __('choose one', 'daphnee'), 'twitter' => 'Twitter', 'facebook' => 'Facebook', 'google' => 'Google', 'pinterest' => 'Pinterest', 'foursquare' => 'Foursquare', 'yahoo' => 'Yahoo', 'skype' => 'Skype', 'yelp' => 'Yelp', 'feedburner' => 'Feedburner', 'linkedin' => 'LinkedIn', 'viadeo' => 'Viadeo', 'xing' => 'Xing', 'myspace' => 'Myspace', 'soundcloud' => 'Soundcloud', 'spotify' => 'Spotify', 'grooveshark' => 'Grooveshark', 'lastfm' => 'LastFM', 'youtube' => 'YouTube', 'vimeo' => 'Vimeo', 'dailymotion' => 'Dailymotion', 'vine' => 'Vine', 'flickr' => 'Flickr', '500px' => '500px', 'instagram' => 'Instagram', 'wordpress' => 'WordPress', 'tumblr' => 'Tumblr', 'blogger' => 'Blogger', 'technorati' => 'Technorati', 'reddit' => 'Reddit', 'dribbble' => 'Dribbble', 'stumbleupon' => 'StumbleUpon', 'digg' => 'Digg', 'envato' => 'Envato', 'behance' => 'Behance', 'delicious' => 'Delicious', 'deviantart' => 'Deviantart', 'forrst' => 'Forrst', 'playstore' => 'Playstore', 'zerply' => 'Zerply', 'wikipedia' => 'Wikipedia', 'apple' => 'Apple', 'flattr' => 'Flattr', 'github' => 'Github', 'chimein' => 'Chimein', 'friendfeed' => 'Friendfeed', 'newsvine' => 'Newsvine', 'identica' => 'Identica', 'bebo' => 'Bebo', 'zynga' => 'Zynga', 'steam' => 'Steam', 'xbox' => 'Xbox', 'windows' => 'Windows', 'outlook' => 'Outlook', 'coderwall' => 'Coderwall', 'tripadvisor' => 'Tripadvisor', 'appnet' => 'Appnet', 'goodreads' => 'Goodreads', 'tripit' => 'Tripit', 'lanyrd' => 'Lanyrd', 'slideshare' => 'Slideshare', 'buffer' => 'Buffer', 'rss' => 'RSS', 'vkontakte' => 'Vkontakte', 'disqus' => 'Disqus', 'houzz' => 'Houzz', 'mail' => 'Mail', 'patreon' => 'Patreon', 'paypal' => 'Paypal', 'playstation' => 'Playstation', 'smugmug' => 'Smugmug', 'swarm' => 'Swarm', 'triplej' => 'Triplej', 'yammer' => 'Yammer', 'stackoverflow' => 'Stackoverflow', 'drupal' => 'Drupal', 'odnoklassniki' => 'Odnoklassniki', 'android' => 'Android', 'meetup' => 'Meetup', 'persona' => 'Persona', 'amazon' => 'Amazon', 'ello' => 'Ello', 'mixcloud' => 'Mixcloud', '8tracks' => '8tracks', 'twitch' => 'Twitch', 'airbnb' => 'Airbnb')), 'link' => array('type' => 'text', 'label' => 'URL', 'default' => 'https://'))));
}
function daphnee_add_featured_image($content)
{
global $post;
$enabled_post_types = get_theme_mod('featured_image_post_types', array('post'));
if (is_singular() && in_array($post->post_type, $enabled_post_types)) {
$content = get_the_post_thumbnail($post->ID, 'full') . $content;
}
return $content;
}
add_filter('the_content', 'daphnee_add_featured_image');
function daphnee_add_plus_link()
{
if (!Daphnee()->is_plus) {
示例2: test_add_section
public function test_add_section()
{
Kirki::add_section('test_empty', array());
Kirki::add_section('test', array('priority' => 4, 'title' => 'Title', 'description' => 'My Description', 'panel' => 'my_panel'));
$this->assertEquals(array('id' => 'test_empty', 'description' => '', 'priority' => 10, 'active_callback' => '__return_true', 'panel' => ''), Kirki::$sections['test_empty']);
$this->assertEquals(array('id' => 'test', 'title' => 'Title', 'description' => 'My Description', 'priority' => '4', 'active_callback' => '__return_true', 'panel' => 'my_panel'), Kirki::$sections['test']);
$this->assertEquals(2, count(Kirki::$sections));
}
示例3: array
<?php
Kirki::add_section('theme_business_info', array('title' => __('Standardoplysninger'), 'description' => __('Tilføj standarderoplysninger på hjemmesiden.'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_business_info', array('settings' => 'info_name', 'label' => __('Firmanavn', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_address', 'label' => __('Adresse', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_post', 'label' => __('Postnummer', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_city', 'label' => __('By', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_cvr', 'label' => __('CVR', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_email', 'label' => __('Email', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_telefon', 'label' => __('Telefon', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_heading', 'label' => __('Hjemmesidens overskrift', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_business_info', array('settings' => 'info_subheading', 'label' => __('Hjemmesidens underoverskrift', 'smamo'), 'type' => 'text', 'section' => 'theme_business_info', 'priority' => 10, 'default' => null));
示例4: kirki_hooks_init
function kirki_hooks_init()
{
Kirki::add_config('my_kirki_repeater', array('capability' => 'edit_theme_options', 'option_type' => 'option', 'option_name' => 'my_kirki_repeater'));
Kirki::add_section('my_kirki_repeater_section', array('title' => __('Kirki Repeater', 'kirki'), 'description' => __('Add custom CSS here', 'kirki'), 'panel' => '', 'priority' => 1, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
}
示例5: array
<?php
if (class_exists('Kirki')) {
Kirki::add_section('mailchimp', array('title' => __('Mailchimp'), 'description' => __('Tilføj API tilgang til mailchimp'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('mailchimp_api', array('settings' => 'mailchimp_api', 'label' => __('API nøgle', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => '40bbbefd42e7b7fd5e22c5e0e9ca61b3-us10'));
Kirki::add_field('list_ID', array('settings' => 'list_ID', 'label' => __('Liste ID', 'smamo'), 'section' => 'mailchimp', 'type' => 'text', 'priority' => 10, 'default' => '51f08ecfa7'));
}
示例6: array
/**
* Add sections
*/
$wp_customize->add_section('controls_with_choices', array('title' => __('Controls with Choices', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('color_section', array('title' => __('Color Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('file_controls_section', array('title' => __('File & Image Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('text_section', array('title' => __('Text Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('background_section', array('title' => __('Background Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('numeric', array('title' => __('Numeric Controls', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
$wp_customize->add_section('custom_section', array('title' => __('Custom Control', 'kirki'), 'priority' => 10, 'description' => __('This is the section description', 'kirki')));
}
add_action('customize_register', 'kirki_demo_sections');
/**
* Create panels using the Kirki API
*/
Kirki::add_section('boolean_controls', array('priority' => 10, 'title' => __('Boolean Controls', 'kirki'), 'description' => __('This panel contains controls that return true/false Controls', 'kirki')));
/**
* Add controls using the 'kirki/fields' filter.
*/
function kirki_controls_with_choices_fields($fields)
{
$fields[] = array('type' => 'radio', 'settings' => 'radio_demo', 'label' => __('Radio Control', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
$fields[] = array('type' => 'dropdown-pages', 'settings' => 'dropdown_pages_demo', 'label' => __('Dropdown Pages', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'priority' => 10);
$fields[] = array('type' => 'select', 'settings' => 'select_demo', 'label' => __('Select', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
$fields[] = array('type' => 'radio-image', 'settings' => 'radio_image_demo', 'label' => __('Radio-Image', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => admin_url() . '/images/align-left-2x.png', 'option-2' => admin_url() . '/images/align-center-2x.png', 'option-3' => admin_url() . '/images/align-right-2x.png'));
$fields[] = array('type' => 'radio-buttonset', 'settings' => 'radio_buttonset_demo', 'label' => __('Radio-Buttonset', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'option-1', 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki')));
$fields[] = array('type' => 'multicheck', 'settings' => 'multicheck_demo', 'label' => __('Multicheck', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => array('option-1', 'option-2'), 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki')));
$fields[] = array('type' => 'sortable', 'settings' => 'sortable_demo', 'label' => __('Sortable', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => array('option-3', 'option-1', 'option-4'), 'priority' => 10, 'choices' => array('option-1' => __('Option 1', 'kirki'), 'option-2' => __('Option 2', 'kirki'), 'option-3' => __('Option 3', 'kirki'), 'option-4' => __('Option 4', 'kirki'), 'option-5' => __('Option 5', 'kirki'), 'option-6' => __('Option 6', 'kirki')));
// Define custom palettes
$fields[] = array('type' => 'palette', 'settings' => 'palette_demo', 'label' => __('Palette', 'kirki'), 'description' => __('This is the control description', 'kirki'), 'help' => __('This is some extra help. You can use this to add some additional instructions for users. The main description should go in the "description" of the field, this is only to be used for help tips.', 'kirki'), 'section' => 'controls_with_choices', 'default' => 'red', 'priority' => 10, 'choices' => array('red' => array('#ef9a9a', '#f44336', '#ff1744'), 'pink' => array('#fce4ec', '#f06292', '#e91e63', '#ad1457', '#f50057'), 'cyan' => array('#e0f7fa', '#80deea', '#26c6da', '#0097a7', '#00e5ff')));
// Define custom palettes
示例7: array
<?php
Kirki::add_section('theme_logo', array('title' => __('Logo'), 'description' => __('Vælg et logo til hjemmesiden'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_logo', array('settings' => 'logo', 'label' => __('Logo', 'smamo'), 'type' => 'image', 'section' => 'theme_logo', 'priority' => 10, 'default' => null));
示例8: array
<?php
Kirki::add_section('footer', array('title' => __('Footer'), 'description' => __('Oplysninger, som vises i hjemmesidens Footer'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Skolenavn', 'fagy'), 'setting' => 'ft_school', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Adresselinje', 'fagy'), 'setting' => 'ft_address', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Postnummer og by', 'fagy'), 'setting' => 'ft_post_city', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Telefonnummer', 'fagy'), 'setting' => 'ft_phone', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Emailadresse', 'fagy'), 'setting' => 'ft_email', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('CVR - nummer', 'fagy'), 'setting' => 'ft_cvr', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('EAN - nummer', 'fagy'), 'setting' => 'ft_ean', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Skolenummer', 'fagy'), 'setting' => 'ft_school_no', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Eksamensnummer', 'fagy'), 'setting' => 'ft_exam_no', 'section' => 'footer'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Åbningstid', 'fagy'), 'setting' => 'ft_open', 'section' => 'footer'));
示例9: array
<?php
Kirki::add_section('facebook', array('title' => __('Facebook App'), 'description' => __('Oplysninger, som bruges til at hente Nyheder og kalenderbegivenheder fra Facebook\'s API'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Facebook side', 'fagy'), 'setting' => 'facebook_page', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Endpoint base', 'fagy'), 'description' => __('bruges som base for endpoints i kald til Facebooks api'), 'setting' => 'smamo_fb_api_base', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('APP ID', 'fagy'), 'description' => __('Findes i indstillingerne for den App, du har oprettet.'), 'setting' => 'smamo_fb_app_id', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('APP SECRET', 'fagy'), 'description' => __('Findes i indstillingerne for den App, du har oprettet.'), 'setting' => 'smamo_fb_app_secret', 'section' => 'facebook'));
Kirki::add_field('faaborg_gym', array('type' => 'text', 'label' => __('Redirect URI', 'fagy'), 'description' => __('Bruges til henvisning ved synkrone requests.'), 'setting' => 'smamo_fb_redirect_uri', 'section' => 'facebook'));
示例10: array
<?php
if (class_exists('Kirki')) {
/**
* Add config
*/
Kirki::add_config('my_theme', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
/*
* Add panel
*/
Kirki::add_panel('design', array('priority' => 10, 'title' => esc_attr__('Custom logo', 'twentysixteen-child-headerlogo')));
/**
* Add section
*/
Kirki::add_section('logo', array('title' => esc_attr__('Replace site identity', 'twentysixteen-child-headerlogo'), 'priority' => 1, 'panel' => 'design', 'capability' => 'edit_theme_options'));
/**
* Add logo field
*/
Kirki::add_field('my_theme', array('settings' => 'my_logo', 'label' => __('Choose your brand image', 'twentysixteen-child-headerlogo'), 'description' => __('Replace Twenty Sixteen site title and tagline with your custom logo', 'twentysixteen-child-headerlogo'), 'section' => 'logo', 'type' => 'upload', 'mime_type' => 'image', 'priority' => 10, 'default' => ''));
/* Add SEO 'alt' tag on img element in DOM */
Kirki::add_field('', array('type' => 'switch', 'settings' => 'logo_alt', 'label' => __('ALT tag?', 'twentysixteen-child-headerlogo'), 'description' => __('Add site tagline to logo ALT tag?', 'twentysixteen-child-headerlogo'), 'section' => 'logo', 'default' => '1', 'priority' => 20));
}
示例11: create_section
/**
* Create the Section
*/
public function create_section()
{
Kirki::add_section(sanitize_key($this->field['type']), array('priority' => 10, 'title' => sprintf(__('%s test', 'kirki'), $this->field['type'])));
}
示例12: array
// Adding the Team Showcase panel
Kirki::add_panel('team_showcase', array('priority' => 10, 'title' => __('Team Showcase', 'magnificient'), 'description' => __('A section to show your team', 'magnificient')));
// Adding the Frontpage Separate Page Content panel
Kirki::add_panel('front_page_separate_page_content', array('priority' => 10, 'title' => __('Frontpage Separate Page Content', 'magnificient'), 'description' => __('A section to fetch content from another page', 'magnificient')));
// Adding the Product Slider for Homepage section
Kirki::add_section('product_slider_for_homepage', array('title' => __('Product Slider for Homepage', 'magnificient'), 'description' => __('This slider will be shown on the front page of your website', 'magnificient'), 'panel' => 'product_slider', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Images for Homepage section
Kirki::add_section('product_images_for_homepage', array('title' => __('Product Images for Homepage', 'magnificient'), 'description' => __('These images will be shown on the product description panels on the front page of your website', 'magnificient'), 'panel' => 'product_description', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Description for Homepage section
Kirki::add_section('product_description_for_homepage', array('title' => __('Product Description for Homepage', 'magnificient'), 'description' => __('These panels will be shown on the front page of your website', 'magnificient'), 'panel' => 'product_description', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Details for Homepage section
Kirki::add_section('product_details_for_homepage', array('title' => __('Product Details for Homepage', 'magnificient'), 'description' => __('This will show the details on the front page of your website', 'magnificient'), 'panel' => 'product_details', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Team Showcase for Homepage section
Kirki::add_section('team_showcase_for_homepage', array('title' => __('Team Showcase for Homepage', 'magnificient'), 'description' => __('This will show the team members on the front page of your website', 'magnificient'), 'panel' => 'team_showcase', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Frontpage Separate Page Content for Homepage section
Kirki::add_section('front_page_separate_page_content_for_homepage', array('title' => __('Frontpage Separate Page Content for Homepage', 'magnificient'), 'description' => __('This will show the separate page content on the front page of your website', 'magnificient'), 'panel' => 'front_page_separate_page_content', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
// Adding the Product Slider image 1 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_1', 'label' => __('Product Slider image 1', 'magnificient'), 'description' => __('This image will be the first image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 2 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_2', 'label' => __('Product Slider image 2', 'magnificient'), 'description' => __('This image will be the second image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 3 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_3', 'label' => __('Product Slider image 3', 'magnificient'), 'description' => __('This image will be the third image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 4 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_4', 'label' => __('Product Slider image 4', 'magnificient'), 'description' => __('This image will be the fourth image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider image 5 field
Kirki::add_field('mc', array('type' => 'image', 'settings' => 'product_slider_image_5', 'label' => __('Product Slider image 5', 'magnificient'), 'description' => __('This image will be the fifth image for the Product Slider.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => '', 'priority' => 10));
// Adding the Product Slider caption 1 field
Kirki::add_field('mc', array('type' => 'text', 'settings' => 'product_slider_caption_1', 'label' => __('Product Slider caption 1', 'magnificient'), 'description' => __('This caption will be the description for the first slide.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => __('This is some default text', 'magnificient'), 'priority' => 10));
// Adding the Product Slider caption 2 field
Kirki::add_field('mc', array('type' => 'text', 'settings' => 'product_slider_caption_2', 'label' => __('Product Slider caption 2', 'magnificient'), 'description' => __('This caption will be the description for the second slide.', 'magnificient'), 'section' => 'product_slider_for_homepage', 'default' => __('This is some default text', 'magnificient'), 'priority' => 10));
// Adding the Product Slider caption 3 field
示例13: add_action
$wp_customize->get_control('site_icon')->priority = 20;
$wp_customize->get_control('site_icon')->section = 'site_general';
}
add_action('customize_register', 'beagency_remove_customize_section', 1000);
// Early exit if Kirki is not installed
if (!class_exists('Kirki')) {
return;
}
/**
* Create panels using the Kirki API.
*/
Kirki::add_section('site_general', array('priority' => 10, 'title' => __('General', 'beagency'), 'description' => __('You may need to refresh the page to see the changes.', 'beagency')));
Kirki::add_section('site_homepage', array('priority' => 20, 'title' => __('Homepage', 'beagency'), 'description' => __('Here you can customize your homepage.', 'beagency'), 'active_callback' => 'is_front_page'));
Kirki::add_section('site_404_page', array('priority' => 30, 'title' => __('404 Page', 'beagency'), 'description' => __('Here you can customize your 404 Page.', 'beagency'), 'active_callback' => 'is_404'));
Kirki::add_section('site_footer', array('priority' => 120, 'title' => __('Site Footer', 'beagency'), 'description' => __('Here you can customize the footer on your site.', 'beagency')));
Kirki::add_section('upgrade_theme', array('priority' => 130, 'title' => __('Upgrade', 'beagency')));
/**
* Create a config instance that will be used by fields added via the static methods.
*/
Kirki::add_config('beagency_kirki', array('option_type' => 'theme_mod'));
/**
* Create fields using the Kirki API static functions.
*/
Kirki::add_field('beagency_kirki', array('type' => 'text', 'settings' => 'general_site_title', 'label' => __('Site Title', 'beagency'), 'section' => 'site_general', 'default' => get_bloginfo('name'), 'priority' => 10, 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.site-title a', 'function' => 'html', 'property' => 'text'))));
Kirki::add_field('beagency_kirki', array('type' => 'dropdown-pages', 'settings' => 'general_front_page', 'label' => __('Front Page', 'beagency'), 'help' => __('Create a blank page with Home Page template and set it as Front Page.', 'beagency'), 'section' => 'site_general', 'default' => get_option('page_on_front'), 'priority' => 20));
Kirki::add_field('beagency_kirki', array('type' => 'dropdown-pages', 'settings' => 'general_posts_page', 'label' => __('Posts Page', 'beagency'), 'help' => __('Create a blank page and set it as Posts Page.', 'beagency'), 'section' => 'site_general', 'default' => get_option('page_for_posts'), 'priority' => 30));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'general_sticky_menu', 'label' => __('Enable Sticky Menu?', 'beagency'), 'help' => __('If enable, the menu will be accessible from anywhere without having to scroll.', 'beagency'), 'section' => 'site_general', 'default' => '1', 'priority' => 40));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'general_go_to_top', 'label' => __('Enable Go to Top Button?', 'beagency'), 'section' => 'site_general', 'default' => '1', 'priority' => 50));
Kirki::add_field('beagency_kirki', array('type' => 'checkbox', 'settings' => 'homepage_heading', 'label' => __('Enable Heading Block?', 'beagency'), 'section' => 'site_homepage', 'default' => '1', 'priority' => 10));
Kirki::add_field('beagency_kirki', array('type' => 'textarea', 'settings' => 'homepage_heading_h1', 'label' => __('Heading', 'beagency'), 'help' => __('If you want to color the word, just wrap it with \\"span\\" tag.', 'beagency'), 'section' => 'site_homepage', 'default' => 'Hello, We are <span>BeTheme</span>. We <span><i class="fa fa-heart-o"></i></span> WordPress!', 'priority' => 20, 'required' => array(array('setting' => 'homepage_heading', 'operator' => '==', 'value' => 1))));
Kirki::add_field('beagency_kirki', array('type' => 'textarea', 'settings' => 'homepage_heading_span', 'label' => __('Content', 'beagency'), 'section' => 'site_homepage', 'default' => 'We handcraft well-thought-out WordPress themes built on solid coding and elegant design.', 'priority' => 30, 'required' => array(array('setting' => 'homepage_heading', 'operator' => '==', 'value' => 1))));
示例14: array
Kirki::add_section('topbar_color_settings', array('title' => __('Topbar Colors', 'lathom'), 'description' => __('Configure Color Settings for the Topbar', 'lathom'), 'panel' => 'topbar', 'priority' => 20, 'capability' => 'edit_theme_options'));
// Kirki::add_panel( 'menue', array(
// 'priority' => 210,
// 'title' => __( 'Offcanvas Menu Configuration', 'lathom' ),
// 'description' => __( '', 'lathom' ),
// ) );
Kirki::add_section('menu_settings', array('title' => __('Offcanvas Menu Settings', 'lathom'), 'description' => __('', 'lathom'), 'panel' => '', 'priority' => 220, 'capability' => 'edit_theme_options'));
Kirki::add_panel('content', array('priority' => 230, 'title' => __('Content Settings', 'lathom'), 'description' => __('My Description', 'lathom')));
Kirki::add_section('content_features', array('title' => __('Content Features', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 10, 'capability' => 'edit_theme_options'));
Kirki::add_section('article_features', array('title' => __('Article Features', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 15, 'capability' => 'edit_theme_options'));
Kirki::add_section('article_colors', array('title' => __('Article Colors', 'lathom'), 'description' => __('', 'lathom'), 'panel' => 'content', 'priority' => 20, 'capability' => 'edit_theme_options'));
Kirki::add_section('sidebar_colors', array('title' => __('Sidebar Configuration', 'lathom'), 'description' => __('Configure Sidebar Settings', 'lathom'), 'panel' => 'content', 'priority' => 30, 'capability' => 'edit_theme_options'));
Kirki::add_panel('footer', array('priority' => 260, 'title' => __('Footer Configuration', 'lathom'), 'description' => __('', 'lathom')));
Kirki::add_section('footerwidgets_settings', array('title' => __('Footer Widgets Settings', 'lathom'), 'description' => __('Configure Settings for the Footer Widgets Area', 'lathom'), 'panel' => 'footer', 'priority' => 10, 'capability' => 'edit_theme_options'));
Kirki::add_section('footer_settings', array('title' => __('Footer Settings', 'lathom'), 'description' => __('Configure Settings for the Footer', 'lathom'), 'panel' => 'footer', 'priority' => 10, 'capability' => 'edit_theme_options'));
Kirki::add_section('custom_code', array('title' => __('Custom Code', 'lathom'), 'description' => __('You can inject your own CSS and Javascript without modifying any of the theme files.', 'lathom'), 'panel' => '', 'priority' => 270, 'capability' => 'edit_theme_options'));
/**
* Add the configuration.
* This way all the fields using the 'lathom' ID
* will inherit these options
*/
Kirki::add_config('lathom', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
/**
* Font Settings
*/
Kirki::add_field('base_typography', array('type' => 'typography', 'settings' => 'base_typography_config', 'label' => esc_attr__('Base Typography', 'lathom'), 'description' => esc_attr__('Configures the overall Font for the whole Site.', 'lathom'), 'help' => esc_attr__('', 'lathom'), 'section' => 'typography', 'default' => array('font-style' => array('bold', 'italic'), 'font-family' => 'Open Sans', 'font-size' => '16', 'font-weight' => '400', 'line-height' => '1.5', 'letter-spacing' => '-0.004', 'word-spacing' => '0.125'), 'priority' => 10, 'choices' => array('font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true, 'word-spacing' => true, 'units' => array('px', 'rem')), 'output' => array(array('element' => 'body'))));
Kirki::add_field('headline_typography', array('type' => 'typography', 'settings' => 'headline_typography_config', 'label' => esc_attr__('Headline Typography', 'lathom'), 'description' => esc_attr__('Configures Headline Fonts for the Site.', 'lathom'), 'help' => esc_attr__('', 'lathom'), 'section' => 'typography', 'default' => array('font-style' => array('bold'), 'font-family' => 'Titillium Web', 'font-weight' => '800', 'letter-spacing' => '0.125', 'word-spacing' => '0.125'), 'priority' => 10, 'choices' => array('font-style' => true, 'font-family' => true, 'font-weight' => true, 'letter-spacing' => true, 'word-spacing' => true, 'units' => array('px', 'rem')), 'output' => array(array('element' => 'h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6'))));
/**
* Topbar text settings
*/
Kirki::add_field('lathom', array('type' => 'switch', 'settings' => 'display_brand_image', 'label' => __('Display Brand Image?', 'lathom'), 'description' => __('', 'lathom'), 'help' => __('', 'lathom'), 'section' => 'topbar_features', 'default' => '1', 'priority' => 10));
示例15: array
<?php
if (class_exists('Kirki')) {
Kirki::add_section('site_info', array('title' => __('Information'), 'description' => __('Tilføj generel info, som bruges på hele hjemmesiden'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('info_long_description', array('settings' => 'info_long_description', 'label' => __('Lang beskrivelse', 'smamo'), 'section' => 'site_info', 'type' => 'editor', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_name', array('settings' => 'info_name', 'label' => __('Navn', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_address', array('settings' => 'info_address', 'label' => __('Adresse', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_post', array('settings' => 'info_post', 'label' => __('Postnummer', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_by', array('settings' => 'info_by', 'label' => __('By', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_email', array('settings' => 'info_email', 'label' => __('Email', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
Kirki::add_field('info_telefon', array('settings' => 'info_telefon', 'label' => __('Telefon', 'smamo'), 'section' => 'site_info', 'type' => 'text', 'priority' => 10, 'default' => ''));
}