add_field() public static méthode

Create a new field.
public static add_field ( string $config_id, array $args )
$config_id string The configuration ID for this field.
$args array The field arguments.
 public function test_customize_controls_print_scripts()
 {
     Kirki::add_field('', array('settings' => 'foo', 'type' => 'text', 'section' => 'bar', 'help' => 'Lorem Ipsum'));
     $script = '$( "<a href=\'#\' class=\'tooltip hint--left\' data-hint=\'Lorem Ipsum\'><span class=\'dashicons dashicons-info\'></span></a>" ).prependTo( "#customize-control-foo" );';
     $this->expectOutputString('<script>jQuery(document).ready(function($) { "use strict"; ' . $script . '});</script>');
     Kirki()->scripts->tooltips->customize_controls_print_footer_scripts();
 }
Exemple #2
0
 public function add_field()
 {
     Kirki::add_field('my_config', array('settings' => 'my_setting', 'label' => __('My custom control', 'translation_domain'), 'section' => 'my_section', 'type' => 'text', 'priority' => 10, 'default' => 'some-default-value'));
     Kirki::add_field('my_config', array('settings' => 'my_setting0', 'label' => __('My custom control', 'translation_domain'), 'section' => 'my_section', 'type' => 'text', 'priority' => 10, 'default' => 'some-default-value'));
     Kirki::add_field('my_config2', array('settings' => 'my_setting1', 'label' => __('My custom control', 'translation_domain'), 'section' => 'my_section', 'type' => 'text', 'priority' => 10, 'default' => 'some-default-value'));
     Kirki::add_field('my_config3', array('settings' => 'my_setting2', 'label' => __('My custom control', 'translation_domain'), 'section' => 'my_section', 'type' => 'text', 'priority' => 10, 'default' => 'some-default-value'));
     Kirki::add_field('my_config', array('settings' => 'my_setting_2', 'label' => __('My custom control 2', 'translation_domain'), 'section' => 'my_section', 'type' => 'checkbox', 'priority' => 20, 'default' => '1', 'capability' => 'edit_theme_options'));
 }
 /**
  * Process fields added using the 'kirki/fields' and 'kirki/controls' filter.
  * These filters are no longer used, this is simply for backwards-compatibility
  */
 public function fields_from_filters()
 {
     $fields = apply_filters('kirki/controls', array());
     $fields = apply_filters('kirki/fields', $fields);
     if (!empty($fields)) {
         foreach ($fields as $field) {
             Kirki::add_field('global', $field);
         }
     }
 }
 public function test_generate_script()
 {
     $js_vars = array('element' => 'body', 'function' => 'css', 'property' => 'color');
     Kirki::add_field('', array('settings' => 'foo', 'type' => 'text', 'transport' => 'postMessage', 'js_vars' => $js_vars));
     set_theme_mod('foo', '#333');
     $wp_customize = $this->init_customizer();
     $this->assertEquals('wp.customize( \'foo\', function( value ) {value.bind( function( newval ) {$(\'body\').css(\'color\', newval );}); });', Kirki()->scripts->postmessage->generate_script());
     $js_vars = array('element' => 'body', 'function' => 'html');
     Kirki::add_field('', array('settings' => 'foo', 'type' => 'text', 'transport' => 'postMessage', 'js_vars' => $js_vars));
     set_theme_mod('foo', 'this is a string');
     $wp_customize = $this->init_customizer();
     $this->assertEquals('wp.customize( \'foo\', function( value ) {value.bind( function( newval ) {$(\'body\').html( newval );}); });', Kirki()->scripts->postmessage->generate_script());
 }
 /**
  * Add fields using the Kirki API
  */
 public function add_fields_via_api()
 {
     $args = $this->field;
     $args['section'] = sanitize_key($this->field['type']);
     $args['capability'] = 'read';
     $args['settings'] = sanitize_key($this->field['type']) . '_demo_3';
     $args['label'] = sprintf(__('%s theme_mod via API', 'kirki'), $args['type']);
     $args['option_type'] = 'theme_mod';
     Kirki::add_field('', $args);
     $args['settings'] = sanitize_key($this->field['type']) . '_demo_4';
     $args['label'] = sprintf(__('%s single option via API', 'kirki'), $args['type']);
     $args['option_type'] = 'option';
     Kirki::add_field('', $args);
     $args['settings'] = sanitize_key($this->field['type']) . '_demo_5';
     $args['option_type'] = 'option';
     $args['label'] = sprintf(__('%s serialized option via API', 'kirki'), $args['type']);
     $args['option_name'] = 'kirki_test';
     Kirki::add_field('', $args);
 }
Exemple #6
0
    Kirki::add_field('kirki_demo', array('type' => 'checkbox', 'settings' => 'checkbox_demo', 'label' => esc_attr__('Checkbox demo', 'kirki'), 'description' => esc_attr__('This is a simple checkbox', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'switch', 'settings' => 'switch_demo', 'label' => esc_attr__('Switch demo', 'kirki'), 'description' => esc_attr__('This is a switch control. Internally it is a checkbox and you can also change the ON/OFF labels.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10, 'required' => array(array('setting' => 'checkbox_demo', 'operator' => '==', 'value' => true))));
    Kirki::add_field('kirki_demo', array('type' => 'toggle', 'settings' => 'toggle_demo', 'label' => esc_attr__('Toggle demo', 'kirki'), 'description' => esc_attr__('This is a toggle. it is basically identical to a switch, the only difference is that it does not have any labels and to save space it is inline with the label. Internally this is a checkbox.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => true, 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'text', 'settings' => 'text_demo', 'label' => esc_attr__('Text Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'default' => esc_attr__('This text is entered in the "text" control.', 'kirki-demo'), 'section' => 'text', 'default' => '', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'textarea', 'settings' => 'textarea_demo', 'label' => esc_attr__('Textarea Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'default' => esc_attr__('This text is entered in the "textarea" control.', 'kirki-demo'), 'section' => 'text', 'default' => '', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'editor', 'settings' => 'editor_demo', 'label' => esc_attr__('Editor Control', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'text', 'default' => esc_attr__('This text is entered in the "editor" control.', 'kirki-demo'), 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'code', 'settings' => 'code_demo', 'label' => esc_attr__('Code Control', 'kirki'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'description' => esc_attr__('This is a simple code control. You can define the language you want as well as the theme. In this demo we are using a CSS editor with the monokai theme.', 'kirki-demo'), 'section' => 'text', 'default' => 'body { background: #fff; }', 'priority' => 10, 'choices' => array('language' => 'css', 'theme' => 'monokai', 'height' => 250)));
    Kirki::add_field('kirki_demo', array('type' => 'color', 'settings' => 'color_demo', 'label' => esc_attr__('Color Control', 'kirki'), 'description' => esc_attr__('This uses the default WordPress-core color control.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'color', 'default' => '#81d742', 'priority' => 10, 'output' => array(array('element' => '.demo.color p', 'property' => 'color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.demo.color p', 'function' => 'css', 'property' => 'color'))));
    Kirki::add_field('kirki_demo', array('type' => 'color-alpha', 'settings' => 'color_alpha_demo', 'label' => esc_attr__('Color-Alpha Control', 'kirki'), 'description' => esc_attr__('Similar to the default Color control but with a teist: This one allows you to also select an opacity for the color and saves the value as HEX or RGBA depending on the alpha channel\'s value.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'color', 'default' => '#333333', 'priority' => 10, 'output' => array(array('element' => '.demo.color', 'property' => 'background-color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.demo.color', 'function' => 'css', 'property' => 'background-color'))));
    Kirki::add_field('kirki_demo', array('type' => 'custom', 'settings' => 'custom_demo', 'label' => esc_attr__('Custom Control', 'kirki-demo'), 'description' => esc_attr__('This is the control description', 'kirki-demo'), 'help' => esc_attr__('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-demo'), 'section' => 'custom', 'default' => '<div style="padding: 30px;background-color: #333; color: #fff; border-radius: 50px;">You can enter custom markup in this control and use it however you want</div>', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'dimension', 'settings' => 'dimension_demo', 'label' => esc_attr__('Dimension Control', 'kirki'), 'description' => esc_attr__('In this example we are changing the width of the body', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'composite', 'default' => '980px', 'priority' => 10, 'output' => array(array('element' => 'body', 'property' => 'width')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'body', 'property' => 'width', 'function' => 'css'))));
    Kirki::add_field('kirki_demo', array('type' => 'multicheck', 'settings' => 'multicheck_demo', 'label' => esc_attr__('Multicheck control', 'kirki-demo'), 'description' => esc_attr__('You can define choices for this control and it will save the selected values as an array.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'checkbox', 'default' => array('option-1', 'option-3'), 'priority' => 10, 'choices' => array('option-1' => esc_attr__('Option 1', 'kirki-demo'), 'option-2' => esc_attr__('Option 2', 'kirki-demo'), 'option-3' => esc_attr__('Option 3', 'kirki-demo'), 'option-4' => esc_attr__('Option 4', 'kirki-demo'), 'option-5' => esc_attr__('Option 5', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'sortable', 'settings' => 'sortable_demo', 'label' => esc_attr__('Sortable Control', 'kirki-demo'), 'section' => 'checkbox', 'description' => esc_attr__('Similar to the "multicheck" control, you can define choices foir this control and the options will be saved as an array. The main difference between the multicheck control and this one is that this one also allows you to rearrange the order of the items.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'default' => array('option-1', 'option-3'), 'priority' => 10, 'choices' => array('option-1' => esc_attr__('Option 1', 'kirki-demo'), 'option-2' => esc_attr__('Option 2', 'kirki-demo'), 'option-3' => esc_attr__('Option 3', 'kirki-demo'), 'option-4' => esc_attr__('Option 4', 'kirki-demo'), 'option-5' => esc_attr__('Option 5', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'number', 'settings' => 'number_demo', 'label' => esc_attr__('Number Control', 'kirki-demo'), 'description' => esc_attr__('This is a simple num,ber control that allows you to select integer values.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'numeric', 'default' => '10', 'priority' => 10, 'output' => array(array('element' => '.number-demo-border-radius', 'property' => 'border-radius', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.number-demo-border-radius', 'property' => 'border-radius', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 0, 'max' => 30, 'step' => 1)));
    Kirki::add_field('kirki_demo', array('type' => 'slider', 'settings' => 'slider_demo', 'label' => esc_attr__('Slider Control', 'kirki-demo'), 'description' => esc_attr__('Similar to the number control. The main difference is that on this one you can define a min, max & step value thus allowing you to use decimal values instead of just integers.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'numeric', 'default' => '10', 'priority' => 10, 'output' => array(array('element' => '.slider-demo-border-radius', 'property' => 'border-radius', 'units' => 'px')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.slider-demo-border-radius', 'property' => 'border-radius', 'units' => 'px', 'function' => 'css')), 'choices' => array('min' => 0, 'max' => 30, 'step' => 1)));
    Kirki::add_field('kirki_demo', array('type' => 'radio', 'settings' => 'radio_demo', 'label' => esc_attr__('Radio Control', 'kirki-demo'), 'description' => esc_attr__('A simple radio-inputs control.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'radio', 'default' => 'red', 'priority' => 10, 'choices' => array('red' => esc_attr__('Red', 'kirki-demo'), 'green' => esc_attr__('Green', 'kirki-demo'), 'blue' => esc_attr__('Blue', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'radio-buttonset', 'settings' => 'radio_buttonset_demo', 'label' => esc_attr__('Radio-Buttonset Control', 'kirki-demo'), 'description' => esc_attr__('This is a radio control styled as inline buttons. You can use this if you have few options with short titles that will fit in a single line.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'radio', 'default' => 'green', 'priority' => 10, 'choices' => array('red' => esc_attr__('Red', 'kirki-demo'), 'green' => esc_attr__('Green', 'kirki-demo'), 'blue' => esc_attr__('Blue', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'radio-image', 'settings' => 'radio_image_demo', 'label' => esc_attr__('Radio-Image Control', 'kirki'), 'description' => esc_attr__('This is a radio control that allows you to define an image for every option is the array of choices in the field. Useful if you want for example to select a layout. You can even use the images included in the Kirki plugin for that, in the /assets/images directory.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'radio', 'default' => 'left', 'priority' => 10, 'choices' => array('left' => admin_url() . '/images/align-left-2x.png', 'center' => admin_url() . '/images/align-center-2x.png', 'right' => admin_url() . '/images/align-right-2x.png')));
    function kirki_demo_get_palettes()
    {
        return array('light' => array('#ECEFF1', '#FFF176', '#4DD0E1'), 'dark' => array('#37474F', '#F9A825', '#00ACC1'));
    }
    Kirki::add_field('', array('type' => 'palette', 'settings' => 'palette_demo', 'label' => esc_attr__('Palette Control', 'kirki'), 'description' => esc_attr__('This is basically a radio control. It allows you to define an array of colors that will be used in order to convey your message in a visually compelling way.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'radio', 'default' => 'light', 'priority' => 10, 'choices' => kirki_demo_get_palettes()));
    Kirki::add_field('kirki_demo', array('type' => 'typography', 'settings' => 'typography_demo', 'label' => esc_attr__('Typography Control', 'kirki'), 'description' => esc_attr__('This is a composite typography control. It saves the data as an array, and you can define which of the controls you want shown.', 'kirki'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'composite', 'default' => array('font-style' => array('bold', 'italic'), 'font-family' => 'Roboto', 'font-size' => '14', 'font-weight' => '400', 'line-height' => '1.5', 'letter-spacing' => '0'), 'priority' => 10, 'choices' => array('font-style' => true, 'font-family' => true, 'font-size' => true, 'font-weight' => true, 'line-height' => true, 'letter-spacing' => true), 'output' => array(array('element' => 'body'))));
    Kirki::add_field('kirki_demo', array('type' => 'repeater', 'label' => esc_attr__('Repeater Control', 'kirki'), 'description' => esc_attr__('The "repeater" control allows you to create rows of data and you can define the fields that the rows will use. Valide field-types are: text, checkbox, radio, select, textarea. The data is saves as a multi-dimentional array.'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'composite', 'priority' => 10, 'settings' => 'repeater_demo', 'default' => array(array('link_text' => esc_attr__('Kirki Site', 'kirki-demo'), 'link_url' => 'https://kirki.org'), array('link_text' => esc_attr__('Kirki Repository', 'kirki-demo'), 'link_url' => 'https://github.com/aristath/kirki')), 'fields' => array('link_text' => array('type' => 'text', 'label' => esc_attr__('Link Text', 'kirki-demo'), 'description' => esc_attr__('This will be the label for your link', 'kirki-demo'), 'default' => ''), 'link_url' => array('type' => 'text', 'label' => esc_attr__('Link URL', 'kirki-demo'), 'description' => esc_attr__('This will be the link URL', 'kirki-demo'), 'default' => ''))));
    Kirki::add_field('kirki_demo', array('type' => 'select', 'settings' => 'select_demo', 'label' => esc_attr__('Select Control', 'kirki-demo'), 'description' => esc_attr__('A simple select (dropdown) control, allowing you to make a single option from a relatively large pool of options.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'select', 'default' => 'green', 'priority' => 10, 'choices' => array('' => esc_attr__('Placeholder Text', 'kirki-demo'), 'red' => esc_attr__('Red', 'kirki-demo'), 'green' => esc_attr__('Green', 'kirki-demo'), 'blue' => esc_attr__('Blue', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'select', 'settings' => 'select_multiple_demo', 'label' => esc_attr__('Select Control (multiple)', 'kirki-demo'), 'description' => esc_attr__('A multi-select control, allowing you to select multiple items simultaneously as well as re-arrange them at will using a simple drag-n-drop interface. Data is saved as an array.', 'kirki-demo'), 'help' => esc_attr__('This is a tooltip', 'kirki-demo'), 'section' => 'select', 'default' => array('option-1'), 'priority' => 10, 'multiple' => 3, 'choices' => array('option-1' => esc_attr__('Option 1', 'kirki-demo'), 'option-2' => esc_attr__('Option 2', 'kirki-demo'), 'option-3' => esc_attr__('Option 3', 'kirki-demo'), 'option-4' => esc_attr__('Option 4', 'kirki-demo'), 'option-5' => esc_attr__('Option 5', 'kirki-demo'))));
    Kirki::add_field('kirki_demo', array('type' => 'preset', 'settings' => 'preset_demo', 'label' => esc_attr__('Preset control', 'kirki-demo'), 'description' => esc_attr__('Bulk-changes the value of other controls.', 'kirki-demo'), 'section' => 'select', 'default' => '1', 'priority' => 10, 'multiple' => 3, 'choices' => array('1' => array('label' => esc_attr__('Option 1', 'kirki-demo'), 'settings' => array('select_demo' => 'red', 'select_multiple_demo' => array('option-1', 'option-2'), 'color_demo_preset' => '#0088cc', 'color_alpha_preset' => 'rgba(237,226,23,0.58)')), '2' => array('label' => esc_attr__('Option 2', 'kirki-demo'), 'settings' => array('select_demo' => 'green', 'select_multiple_demo' => array('option-4', 'option-1'), 'color_demo_preset' => '#333333', 'color_alpha_preset' => 'rgba(181,18,178,0.58)')))));
    Kirki::add_field('kirki_demo', array('type' => 'color', 'settings' => 'color_demo_preset', 'label' => esc_attr__('Color Control', 'kirki'), 'section' => 'select', 'default' => '#81d742', 'priority' => 10));
    Kirki::add_field('kirki_demo', array('type' => 'color-alpha', 'settings' => 'color_alpha_preset', 'label' => esc_attr__('Color Alpha Control', 'kirki'), 'section' => 'select', 'default' => '#ffffff', 'priority' => 10));
}
Exemple #7
0
<?php

/**
 * Site General
 * ================
 */
$section = 'site_general';
$priority = 3;
Kirki::add_field('tm-polygon', array('type' => 'select', 'setting' => 'skin', 'label' => esc_html__('Skin', 'tm-polygon'), 'section' => $section, 'choices' => apply_filters('tm_customizer_skins', array()), 'priority' => 1, 'default' => apply_filters('tm_customizer_default_skin', ''), 'transport' => 'postMessage'));
if (function_exists('tm_bread_crumb')) {
    Kirki::add_field('tm-polygon', array('type' => 'custom', 'setting' => 'site_general_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Breadcrumb</div>'));
    Kirki::add_field('tm-polygon', array('type' => 'toggle', 'setting' => 'site_general_breadcrumb_enable', 'label' => esc_html__('Breadcrumb', 'tm-polygon'), 'description' => esc_html__('Enabling this option will display breadcrumb on every page', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 1));
    Kirki::add_field('tm-polygon', array('type' => 'custom', 'setting' => 'site_general_hr_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<hr />', 'required' => array(array('setting' => 'site_general_breadcrumb_enable', 'operator' => '==', 'value' => 1))));
    Kirki::add_field('tm-polygon', array('type' => 'text', 'setting' => 'site_general_breadcrumb_home_text', 'label' => esc_html__('"Home" text', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 'Home', 'required' => array(array('setting' => 'site_general_breadcrumb_enable', 'operator' => '==', 'value' => 1))));
    Kirki::add_field('tm-polygon', array('type' => 'custom', 'setting' => 'site_general_hr_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<hr />', 'required' => array(array('setting' => 'site_general_breadcrumb_enable', 'operator' => '==', 'value' => 1))));
    Kirki::add_field('tm-polygon', array('type' => 'text', 'setting' => 'site_general_breadcrumb_you_are_here_text', 'label' => esc_html__('"You are here" text', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 'You are here:', 'required' => array(array('setting' => 'site_general_breadcrumb_enable', 'operator' => '==', 'value' => 1))));
}
Kirki::add_field('tm-polygon', array('type' => 'custom', 'setting' => 'site_general_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Other settings</div>'));
Kirki::add_field('tm-polygon', array('type' => 'toggle', 'setting' => 'site_general_boxed', 'label' => esc_html__('Boxed mode', 'tm-polygon'), 'description' => esc_html__('Turn on this option if you want to enable box mode for content', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 0));
Exemple #8
0
    $wp_customize->add_control(new ocin_lite_Display_Text_Control($wp_customize, 'ocin_lite_probtn_colors', array('section' => 'colors', 'label' => sprintf(__('Check out the <a href="%s" target="_blank">PRO version</a> to change Text, Links and Featured colors.', 'ocin-lite'), 'https://www.quemalabs.com/theme/ocin/'))));
    /*
    	Shop Categories selection
    	------------------------------ */
    if (class_exists('WooCommerce') || class_exists('Kirki')) {
        $wp_customize->add_section('ocin_lite_shop_options', array('title' => esc_attr__('Shop Options', 'ocin-lite'), 'priority' => 120));
        $wp_customize->add_setting('ocin_lite_shop_categories', array('default' => array(''), 'sanitize_callback' => 'ocin_lite_sanitize_multicheck', 'type' => 'theme_mod'));
        $all_categories = get_categories(array('taxonomy' => 'product_cat'));
        $woo_categories = array();
        if ($all_categories) {
            foreach ($all_categories as $cat) {
                $woo_categories[$cat->slug] = $cat->name;
            }
        }
        $wp_customize->add_control(new Kirki_Controls_MultiCheck_Control($wp_customize, 'ocin_lite_shop_categories', array('label' => esc_attr__('Shop Categories', 'ocin-lite'), 'section' => 'ocin_lite_shop_options', 'choices' => $woo_categories, 'description' => esc_attr__('Select categories for the shop categories menu.', 'ocin-lite'))));
        Kirki::add_field('ocin_lite_shop_products_amount', array('type' => 'number', 'settings' => 'ocin_lite_shop_products_amount', 'label' => esc_attr__("Number of products", 'ocin-lite'), 'description' => esc_attr__('Number of products displayed per page.', 'ocin-lite'), 'section' => 'ocin_lite_shop_options', 'default' => 12));
    }
    //if plugin exists
    /*
    	PRO Version
    	------------------------------ */
    $wp_customize->add_section('ocin_lite_pro_section', array('title' => esc_attr__('PRO version', 'ocin-lite'), 'priority' => 160));
    $wp_customize->add_setting('ocin_lite_probtn', array('default' => '', 'sanitize_callback' => 'coni_sanitize_text'));
    $wp_customize->add_control(new ocin_lite_Display_Text_Control($wp_customize, 'ocin_lite_probtn', array('section' => 'ocin_lite_pro_section', 'label' => sprintf(__('Check out the PRO version for more features. %s View PRO version %s', 'ocin-lite'), '<a target="_blank" class="button" href="https://www.quemalabs.com/theme/ocin/?utm_source=Ocin Lite%20Lite%20Theme&amp;utm_medium=Pro%20Button&amp;utm_campaign=Ocin Lite" style="width: 80%; margin: 10px auto; display: block; text-align: center;">', '</a>'))));
}
add_action('customize_register', 'ocin_lite_customize_register');
/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function ocin_lite_customize_preview_js()
{
Exemple #9
0
<?php

/**
 * Footer Layout
 * ==============
 */
$section = 'footer_layout';
$priority = 1;
Kirki::add_field('tm-polygon', array('type' => 'toggle', 'setting' => 'footer_layout_enable', 'label' => esc_html__('Use footer', 'tm-polygon'), 'description' => esc_html__('Enabling this option will display footer area', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 1));
Exemple #10
0
<?php

Kirki::add_section('theme_logo', array('title' => __('Logo'), 'description' => __('Tilføj logo til temaets positioner'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('smamo_conf', array('settings' => 'logo_large', 'label' => __('Stort logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 10, 'default' => null));
Kirki::add_field('smamo_conf', array('settings' => 'logo_medium', 'label' => __('Bredt logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 11, 'default' => null));
Kirki::add_field('smamo_conf', array('settings' => 'logo_small', 'label' => __('Lille logo', 'smamo'), 'section' => 'theme_logo', 'type' => 'image', 'priority' => 12, 'default' => null));
Exemple #11
0
<?php

/**
 *	GENERAL / SITE LOGOS
 */
Kirki::add_field('fb', array('type' => 'image', 'settings' => 'default_logo', 'label' => __('Basic Logo', 'flatbook'), 'description' => __('Optional dimensions: 140px x 30px', 'flatbook'), 'section' => 'site_logos', 'default' => get_template_directory_uri() . '/assets/img/logo.png', 'priority' => 10));
Kirki::add_field('fb', array('type' => 'image', 'settings' => 'retina_logo', 'label' => __('Retina Logo', 'flatbook'), 'description' => __('Double sized (2x) version of the Basic Logo.', 'flatbook'), 'section' => 'site_logos', 'default' => get_template_directory_uri() . '/assets/img/logo@2x.png', 'priority' => 20));
Kirki::add_field('fb', array('type' => 'image', 'settings' => 'small_logo', 'label' => __('Small Logo', 'flatbook'), 'description' => __('Optional dimensions: 80px x 80px', 'flatbook'), 'section' => 'site_logos', 'default' => get_template_directory_uri() . '/assets/img/logo_sm.png', 'priority' => 30));
Kirki::add_field('fb', array('type' => 'image', 'settings' => 'admin_logo', 'label' => __('Admin Logo', 'flatbook'), 'description' => __('Optional dimensions: 170px x 70px', 'flatbook'), 'section' => 'site_logos', 'default' => get_template_directory_uri() . '/assets/img/admin_logo.png', 'priority' => 40));
/**
 *	GENERAL / SOCIAL LINKS
 */
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'behance_url', 'default' => '', 'label' => __('Behance', 'flatbook'), 'section' => 'general_socials', 'priority' => 9));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'bitbucket_url', 'default' => '', 'label' => __('BitBucket', 'flatbook'), 'section' => 'general_socials', 'priority' => 10));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'dribbble_url', 'default' => '', 'label' => __('Dribbble', 'flatbook'), 'section' => 'general_socials', 'priority' => 11));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'facebook_url', 'default' => '', 'label' => __('Facebook', 'flatbook'), 'section' => 'general_socials', 'priority' => 12));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'flickr_url', 'default' => '', 'label' => __('Flickr', 'flatbook'), 'section' => 'general_socials', 'priority' => 13));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'github_url', 'default' => '', 'label' => __('GitHub', 'flatbook'), 'section' => 'general_socials', 'priority' => 14));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'googleplus_url', 'default' => '', 'label' => __('Google+', 'flatbook'), 'section' => 'general_socials', 'priority' => 15));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'instagram_url', 'default' => '', 'label' => __('Instagram', 'flatbook'), 'section' => 'general_socials', 'priority' => 16));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'linkedin_url', 'default' => '', 'label' => __('LinkedIn', 'flatbook'), 'section' => 'general_socials', 'priority' => 17));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'pinterest_url', 'default' => '', 'label' => __('Pinterest', 'flatbook'), 'section' => 'general_socials', 'priority' => 18));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'reddit_url', 'default' => '', 'label' => __('Reddit', 'flatbook'), 'section' => 'general_socials', 'priority' => 19));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'skype_url', 'default' => '', 'label' => __('Skype', 'flatbook'), 'section' => 'general_socials', 'priority' => 20));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'tumblr_url', 'default' => '', 'label' => __('Tumblr', 'flatbook'), 'section' => 'general_socials', 'priority' => 21));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'twitter_url', 'default' => '', 'label' => __('Twitter', 'flatbook'), 'section' => 'general_socials', 'priority' => 22));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'vimeo_url', 'default' => '', 'label' => __('Vimeo', 'flatbook'), 'section' => 'general_socials', 'priority' => 23));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'youtube_url', 'default' => '', 'label' => __('Youtube', 'flatbook'), 'section' => 'general_socials', 'priority' => 24));
Exemple #12
0
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_page_display_footer_widgets', 'label' => __('Display Footer Widgets', 'flatbook'), 'section' => 'blog_page', 'default' => '0', 'priority' => 30));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'blog_posts_per_page', 'label' => __('Posts Per Page', 'flatbook'), 'section' => 'blog_page', 'default' => 4, 'priority' => 33));
Kirki::add_field('fb', array('type' => 'custom', 'settings' => 'panel_blog_title_2', 'section' => 'blog_page', 'default' => '<hr><h3>' . __('Post Layout', 'flatbook') . '</h3>', 'priority' => 35));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_page_display_post_header', 'label' => __('Display Post Header', 'flatbook'), 'section' => 'blog_page', 'default' => '1', 'priority' => 40));
Kirki::add_field('', array('type' => 'radio', 'settings' => 'blog_entry_content_align', 'label' => __('Text Alignment', 'flatbook'), 'section' => 'blog_page', 'default' => 'justify', 'priority' => 45, 'choices' => array('left' => __('Left', 'flatbook'), 'center' => __('Center', 'flatbook'), 'right' => __('Right', 'flatbook'), 'justify' => __('Justify', 'flatbook')), 'output' => array('element' => '.blog .blog-post .entry-content', 'property' => 'text-align'), 'transport' => 'postMessage', 'js_vars' => array('element' => '.blog .blog-post .entry-content', 'function' => 'css', 'property' => 'text-align')));
Kirki::add_field('', array('type' => 'text', 'settings' => 'blog_read_more_text', 'label' => __('Read More Text', 'flatbook'), 'section' => 'blog_page', 'default' => __('Continue Reading', 'flatbook'), 'priority' => 50));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_page_display_post_footer', 'label' => __('Display Post Footer', 'flatbook'), 'section' => 'blog_page', 'default' => '1', 'priority' => 55));
/**
 *  PAGES / SINGLE
 */
Kirki::add_field('fb', array('type' => 'custom', 'settings' => 'panel_blog_single_title_1', 'section' => 'blog_single', 'default' => '<h3>' . __('Page Layout', 'flatbook') . '</h3>', 'priority' => 10));
Kirki::add_field('fb', array('type' => 'color', 'settings' => 'blog_single_background_color', 'label' => __('Background Color', 'flatbook'), 'section' => 'blog_single', 'default' => '#F2ECEC', 'priority' => 12, 'output' => array('element' => '.single', 'property' => 'background-color'), 'transport' => 'postMessage', 'js_vars' => array('element' => 'single', 'function' => 'css', 'property' => 'background-color')));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_single_display_header', 'label' => __('Display Page Header', 'flatbook'), 'section' => 'blog_single', 'default' => '1', 'priority' => 15));
Kirki::add_field('fb', array('type' => 'radio', 'label' => __('Page Header Title', 'flatbook'), 'settings' => 'blog_single_header_title', 'section' => 'blog_single', 'default' => 'blog-page-title', 'priority' => 20, 'choices' => array('blog-page-title' => __('Shows the blog page title', 'flatbook'), 'single-post-title' => __('Shows the single post title', 'flatbook'))));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_single_display_sidebar', 'label' => __('Display Blog Sidebar', 'flatbook'), 'section' => 'blog_single', 'default' => '1', 'priority' => 25));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_single_display_footer_subscribe', 'label' => __('Display Footer Subscribe', 'flatbook'), 'section' => 'blog_single', 'default' => '0', 'priority' => 30));
Kirki::add_field('fb', array('type' => 'switch', 'settings' => 'blog_single_display_footer_widgets', 'label' => __('Display Footer Widgets', 'flatbook'), 'section' => 'blog_single', 'default' => '0', 'priority' => 35));
Kirki::add_field('fb', array('type' => 'custom', 'settings' => 'panel_blog_single_title_2', 'section' => 'blog_single', 'default' => '<hr><h3>' . __('Post Layout', 'flatbook') . '</h3>', 'priority' => 40));
Kirki::add_field('', array('type' => 'radio', 'settings' => 'blog_single_post_content_align', 'label' => __('Post Content Align', 'flatbook'), 'section' => 'blog_single', 'default' => 'left', 'priority' => 45, 'choices' => array('left' => __('Left', 'flatbook'), 'center' => __('Center', 'flatbook'), 'right' => __('Right', 'flatbook'), 'justify' => __('Justify', 'flatbook')), 'output' => array('element' => '.single .blog-post .entry-content', 'property' => 'text-align'), 'transport' => 'postMessage', 'js_vars' => array('element' => '.single .blog-post .entry-content', 'function' => 'css', 'property' => 'text-align')));
/**
 *  PAGES / 404
 */
Kirki::add_field('fb', array('type' => 'custom', 'settings' => 'error_page_title_1', 'section' => 'error_page', 'default' => '<h3>' . __('Page Layout', 'flatbook') . '</h3>', 'priority' => 10));
Kirki::add_field('fb', array('type' => 'color', 'settings' => 'error_page_background_color', 'label' => __('Background Color', 'flatbook'), 'section' => 'error_page', 'default' => '#3D3F3E', 'priority' => 15, 'output' => array('element' => '.error404', 'property' => 'background-color'), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.error404', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('fb', array('type' => 'custom', 'settings' => 'error_page_title_2', 'section' => 'error_page', 'default' => '<hr><h3>' . __('404 Content', 'flatbook') . '</h3>', 'priority' => 20));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'error_page_title', 'label' => __('Heading', 'flatbook'), 'section' => 'error_page', 'default' => __('Oooops...', 'flatbook'), 'priority' => 25));
Kirki::add_field('fb', array('type' => 'textarea', 'settings' => 'error_page_texts', 'label' => __('Paragraph', 'flatbook'), 'section' => 'error_page', 'default' => __('Sorry, the page you are looking for does not exist..', 'flatbook'), 'priority' => 30));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'error_page_home_link_text', 'label' => __('Home Link Text', 'flatbook'), 'section' => 'error_page', 'default' => __('To Homepage', 'flatbook'), 'priority' => 35));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'error_page_custom_link_text', 'label' => __('Custom Link Text', 'flatbook'), 'section' => 'error_page', 'default' => __('Purchase Now', 'flatbook'), 'priority' => 40));
Kirki::add_field('fb', array('type' => 'text', 'settings' => 'error_page_custom_link_url', 'label' => __('Custom Link Url', 'flatbook'), 'section' => 'error_page', 'default' => 'http://themeforest.net/item/flatbook-flat-ebook-selling-wordpress-theme/6023410', 'priority' => 45));
Exemple #13
0
 public function add_theme_mod_field()
 {
     Kirki::add_field('', array('type' => 'text', 'settings' => 'the_mod_option', 'section' => 'my_section', 'default' => 'foo', 'priority' => 20, 'option_type' => 'theme_mod'));
 }
Exemple #14
0
 public static function setSection($config_id, $args = array())
 {
     if (!isset($args['fields']) || !isset($args['subsection']) || isset($args['subsection']) && !$args['subsection']) {
         // This is a panel
         Kirki::$panels[] = array('id' => isset($args['id']) ? sanitize_key($args['id']) : substr(str_shuffle('abcdefghijklmnopqrstuvwxyz-_'), 0, 7), 'title' => isset($args['title']) ? $args['title'] : '', 'priority' => isset($args['priority']) ? $args['priority'] : 10, 'description' => isset($args['desc']) ? $args['desc'] : '');
     } else {
         // This is a section
         // Get the section ID
         if (isset($args['subsection']) && $args['subsection']) {
             $panel = end(array_values(Kirki::$panels));
             $panel_id = $panel['id'];
         }
         Kirki::$sections[] = array('id' => isset($args['id']) ? sanitize_key($args['id']) : substr(str_shuffle("abcdefghijklmnopqrstuvwxyz-_"), 0, 7), 'title' => $args['title'], 'priority' => isset($args['priority']) ? $args['priority'] : 10, 'panel' => isset($panel_id) ? $panel_id : '', 'description' => isset($args['desc']) ? $args['desc'] : '');
         foreach ($args['fields'] as $field) {
             $field['section'] = isset($args['id']) ? sanitize_key($args['id']) : substr(str_shuffle("abcdefghijklmnopqrstuvwxyz-_"), 0, 7);
             $field['settings'] = $field['id'];
             $field['help'] = isset($field['desc']) ? $field['desc'] : '';
             $field['description'] = isset($field['subtitle']) ? $field['subtitle'] : '';
             $field['choices'] = isset($field['options']) ? $field['options'] : '';
             $field['label'] = isset($field['title']) ? $field['title'] : '';
             switch ($field['type']) {
                 case 'ace_editor':
                     $field['type'] = 'textarea';
                     break;
                 case 'button_set':
                     $field['type'] = 'radio-buttonset';
                     break;
                 case 'checkbox':
                     if (isset($field['options']) && is_array($field['options'])) {
                         $field['type'] = 'multicheck';
                     }
                 case 'color_rgba':
                     $field['type'] = 'color-alpha';
                     if (isset($field['default']) && is_array($field['default'])) {
                         $field['default']['color'] = isset($field['default']['color']) ? Kirki_Color::sanitize_hex($field['default']['color'], true) : '#ffffff';
                         $field['default']['alpha'] = isset($field['default']['alpha']) ? $field['default']['alpha'] : '1';
                         $field['default'] = Kirki_Color::get_rgba($field['default']['color'], $field['default']['alpha']);
                     }
                     break;
                 case 'image_select':
                     $field['type'] = 'radio-image';
                     break;
                 case 'info':
                     $fiel['label'] = '';
                     $field['help'] = '';
                     $field['type'] = 'custom';
                     $background_color = '#fcf8e3';
                     $border_color = '#faebcc';
                     $text_color = '#8a6d3b';
                     if (isset($field['style'])) {
                         if ('success' == $field['style']) {
                             $background_color = '#dff0d8';
                             $border_color = '#d6e9c6';
                             $text_color = '#3c763d';
                         } elseif ('critical' == $field['style']) {
                             $background_color = '#f2dede';
                             $border_color = '#ebccd1';
                             $text_color = '#a94442';
                         }
                     }
                     $field['default'] = '<div style="padding: 10px;background:' . $background_color . ';border-radius:4px;border:1px solid ' . $border_color . ';color:' . $text_color . ';">';
                     $field['default'] .= isset($field['title']) ? '<h4>' . $field['title'] . '</h4>' : '';
                     $field['default'] .= isset($field['desc']) ? $field['desc'] : '';
                     $field['default'] .= '</div>';
                     break;
                 case 'palette':
                     $field['choices'] = $field['palettes'];
                     break;
                 case 'raw':
                     $field['default'] = $field['content'];
                     break;
                 case 'select':
                     if (is_array($field['choices'])) {
                         foreach ($field['choices'] as $key => $value) {
                             if (is_array($value)) {
                                 foreach ($value as $child_key => $child_value) {
                                     $field['choices'][$child_key] = $child_value;
                                 }
                                 unset($field['choices'][$key]);
                             }
                         }
                     }
                     break;
                 case 'slider':
                     $field['choices'] = array('min' => $field['min'], 'max' => $field['max'], 'step' => $field['step']);
                     break;
                 case 'spinner':
                     $field['type'] = 'number';
                     break;
                 case 'background':
                 case 'border':
                 case 'color_gradient':
                 case 'date':
                 case 'dimensions':
                 case 'divide':
                 case 'gallery':
                 case 'import_export':
                 case 'link_color':
                 case 'media':
                 case 'multi_text':
                 case 'password':
                 case 'section':
                 case 'select_image':
                 case 'sortable':
                 case 'sorter':
                 case 'spacing':
                 case 'spinner':
                 case 'switch':
                 case 'typography':
                 case 'slides':
                     // TODO
                     break;
             }
             Kirki::add_field($config_id, $field);
         }
     }
 }
Exemple #15
0
<?php

/**
 * Header Layout
 * ==============
 */
$section = 'header_layout';
$priority = 1;
Kirki::add_field('tm-polygon', array('type' => 'select', 'setting' => 'header_type', 'label' => esc_html__('Header Type', 'tm-polygon'), 'description' => esc_html__('Choose the header type you want', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 'header01', 'choices' => array('header01' => 'Type 01', 'header02' => 'Type 02', 'header03' => 'Type 03', 'header04' => 'Type 04', 'header_blank' => 'Blank')));
Kirki::add_field('tm-polygon', array('type' => 'toggle', 'setting' => 'header_layout_search_enable', 'label' => esc_html__('Search box', 'tm-polygon'), 'description' => esc_html__('Turn on this option if you want to enable search box on your site', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 1));
if (class_exists('WooCommerce')) {
    Kirki::add_field('tm-polygon', array('type' => 'toggle', 'setting' => 'header_layout_mini_cart_enable', 'label' => esc_html__('Mini Cart', 'tm-polygon'), 'description' => esc_html__('Turn on this option if you want to enable mini cart for header', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => 1));
}
Exemple #16
0
<?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'));
}
Exemple #17
0
<?php

/**
 * Post Style
 * =========
 */
$section = 'post_style';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'post_style_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Title</div>'));
Kirki::add_field('infinity', array('type' => 'select2', 'setting' => 'post_style_heading_font_family', 'label' => __('Font Family', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'Oswald', 'choices' => Kirki_Fonts::get_font_choices(), 'output' => array('element' => '.big-title--single .entry-title', 'property' => 'font-family')));
Kirki::add_field('infinity', array('type' => 'slider', 'setting' => 'post_style_heading_font_weight', 'label' => __('Font Weight', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 700, 'transport' => 'postMessage', 'choices' => array('min' => 100, 'max' => 900, 'step' => 100), 'output' => array('element' => '.big-title--single .entry-title', 'property' => 'font-weight'), 'js_vars' => array(array('element' => '.big-title--single .entry-title', 'function' => 'css', 'property' => 'font-weight'))));
Kirki::add_field('infinity', array('type' => 'slider', 'setting' => 'post_style_heading_letter_spacing', 'label' => __('Letter Spacing', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 0, 'transport' => 'postMessage', 'choices' => array('min' => -1, 'max' => 1, 'step' => 0.05), 'output' => array('element' => '.big-title--single .entry-title', 'property' => 'letter-spacing', 'units' => 'em'), 'js_vars' => array(array('element' => '.big-title--single .entry-title', 'function' => 'css', 'property' => 'letter-spacing', 'units' => 'em'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'post_style_heading_font_color', 'label' => __('Font Color', 'kirki'), 'help' => __('This is some extra help text.', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => '#111111', 'transport' => 'postMessage', 'output' => array(array('element' => '.big-title--single .entry-title', 'property' => 'color')), 'js_vars' => array(array('element' => '.big-title--single .entry-title', 'function' => 'css', 'property' => 'color'))));
Kirki::add_field('infinity', array('type' => 'slider', 'setting' => 'post_style_heading_font_size', 'label' => __('Font Size', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 35, 'choices' => array('min' => 15, 'max' => 100, 'step' => 1), 'transport' => 'postMessage', 'output' => array('element' => '.big-title--single .entry-title', 'property' => 'font-size', 'units' => 'px'), 'js_vars' => array(array('element' => '.big-title--single .entry-title', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
Exemple #18
0
<?php

/**
 * Header Border
 * ============
 */
$section = 'header_border';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'text', 'setting' => 'header_border_width', 'label' => __('Border width', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '0px 0px 0px 0px', 'transport' => 'postMessage', 'output' => array(array('element' => '.site-header', 'property' => 'border-width')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'border-width'))));
Kirki::add_field('infinity', array('type' => 'radio-buttonset', 'setting' => 'header_border_style', 'label' => __('Border style', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => 'solid', 'transport' => 'postMessage', 'choices' => array('solid' => __('Solid', 'infinity'), 'dashed' => __('Dashed', 'infinity'), 'dotted' => __('Dotted', 'infinity'), 'double' => __('Double', 'infinity')), 'output' => array(array('element' => '.site-header', 'property' => 'border-style')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'border-style'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'header_border_color', 'label' => __('Border color', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '#000', 'transport' => 'postMessage', 'output' => array(array('element' => '.site-header', 'property' => 'border-color')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'border-color'))));
Exemple #19
0
<?php

/**
 * Page Spacing
 * =========
 */
$section = 'page_spacing';
$priority = 1;
Kirki::add_field('tm-polygon', array('type' => 'custom', 'setting' => 'page_spacing_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Title</div>'));
Kirki::add_field('tm-polygon', array('type' => 'text', 'setting' => 'page_spacing_padding', 'label' => esc_html__('Padding', 'tm-polygon'), 'section' => $section, 'priority' => $priority++, 'default' => '106px 20px 106px 20px', 'transport' => 'postMessage', 'output' => array('element' => '.big-title .entry-title', 'property' => 'padding')));
Exemple #20
0
<?php

/**
 * Nav Border
 * ================
 */
$section = 'nav_border';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_border_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Main Menu</div>'));
Kirki::add_field('infinity', array('type' => 'text', 'label' => __('Boder width', 'infinity'), 'setting' => 'nav_border_menu_text_border_with', 'section' => $section, 'priority' => $priority++, 'default' => '1px 1px 1px 1px', 'transport' => 'postMessage'));
Kirki::add_field('infinity', array('type' => 'radio-buttonset', 'setting' => 'nav_border_style', 'label' => __('Border style', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => 'solid', 'transport' => 'postMessage', 'choices' => array('solid' => __('Solid', 'infinity'), 'dashed' => __('Dashed', 'infinity'), 'dotted' => __('Dotted', 'infinity'), 'double' => __('Double', 'infinity'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_border_menu_text_border_color', 'label' => __('Color', 'infinity'), 'description' => __('Border color', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => '#999'));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_border_menu_text_border_color_hover', 'description' => __('Border color on hover', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => '#999'));
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_border_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Sub Menu</div>'));
Kirki::add_field('infinity', array('type' => 'text', 'label' => __('Border width', 'infinity'), 'setting' => 'nav_border_sub_menu_text_border_with', 'section' => $section, 'priority' => $priority++, 'default' => '1px 1px 1px 1px', 'transport' => 'postMessage'));
Kirki::add_field('infinity', array('type' => 'radio-buttonset', 'setting' => 'nav_border_sub_menu_style', 'label' => __('Border style', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => 'solid', 'transport' => 'postMessage', 'choices' => array('solid' => __('Solid', 'infinity'), 'dashed' => __('Dashed', 'infinity'), 'dotted' => __('Dotted', 'infinity'), 'double' => __('Double', 'infinity'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_style_sub_menu_text_border_color', 'label' => __('Color', 'infinity'), 'description' => __('Border color', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => '#999'));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_style_sub_menu_text_border_color_hover', 'description' => __('Border color on hover', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => '#999'));
Exemple #21
0
<?php

/**
 * Header Spacing
 * ============
 */
$section = 'header_spacing';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'text', 'setting' => 'header_spacing_padding', 'label' => __('Padding', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '0px 0px 0px 0px', 'transport' => 'postMessage', 'output' => array(array('element' => '.site-header', 'property' => 'padding')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'padding'))));
Kirki::add_field('infinity', array('type' => 'text', 'setting' => 'header_spacing_margin', 'label' => __('Margin', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '0px 0px 0px 0px', 'transport' => 'postMessage', 'output' => array(array('element' => '.site-header', 'property' => 'margin')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'margin'))));
<?php

if (class_exists('Kirki')) {
    Kirki::add_field('daphnee', array('type' => 'textarea', 'settings' => 'footer_copyright_text', 'label' => __('Footer Copyright Text', 'daphnee-plus'), 'section' => 'footer', 'default' => Daphnee_Plus_Helper::default_copyright_text(), 'priority' => 30, 'transport' => 'postMessage', 'js_vars' => array(array('element' => '#colophon .site-info .col_12', 'function' => 'html'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h1', 'label' => __('H1 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '2em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h1'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h2', 'label' => __('H2 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '1.5em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h2'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h3', 'label' => __('H3 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '1.17em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h3'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h4', 'label' => __('H4 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '1em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h4'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h5', 'label' => __('H5 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '0.9em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h5'))));
    Kirki::add_field('daphnee', array('type' => 'typography', 'settings' => 'h6', 'label' => __('H6 Typography Settings', 'daphnee-plus'), 'section' => 'typography_headers', 'default' => array('font-family' => 'Roboto', 'font-weight' => '700', 'font-size' => '0.85em'), 'choices' => array('font-family' => true, 'font-weight' => true, 'font-size' => true), 'priority' => 30, 'output' => array(array('element' => 'h6'))));
}
Exemple #23
0
<?php

/**
 * Site Logo
 * =========
 */
$section = 'site_logo';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'image', 'setting' => 'site_logo', 'label' => __('Logo', 'infinity'), 'description' => __('Choose a default logo image to display', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'http://transport.thememove.com/data/images/logo.png'));
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'site_logo_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Spacing</div>'));
Kirki::add_field('infinity', array('type' => 'text', 'label' => __('Logo Padding', 'infinity'), 'setting' => 'site_logo_padding', 'section' => $section, 'priority' => $priority++, 'default' => '60px 20px 60px 15px', 'transport' => 'postMessage', 'output' => array(array('element' => '.site-branding', 'property' => 'padding', 'prefix' => '@media ( min-width: 62rem ) {', 'suffix' => '}')), 'js_vars' => array(array('element' => '.site-branding', 'function' => 'css', 'property' => 'padding'))));
Exemple #24
0
<?php

/**
 * Button Style
 * ============
 */
$section = 'button_style';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'select2', 'setting' => 'button_style_font_family', 'label' => __('Font Family', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'Oswald', 'choices' => Kirki_Fonts::get_font_choices(), 'output' => array('element' => '.cart_list .wc-forward,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.eg-infinity-features-element-26,.btn,.wpcf7-submit', 'property' => 'font-family')));
Kirki::add_field('infinity', array('type' => 'slider', 'setting' => 'button_style_font_size', 'label' => __('Font Size', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 13, 'choices' => array('min' => 7, 'max' => 48, 'step' => 1), 'transport' => 'postMessage', 'output' => array('element' => '.cart_list .wc-forward,.woocommerce .cart .button, .woocommerce .cart input.button,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.btn', 'property' => 'font-size', 'units' => 'px'), 'js_vars' => array(array('element' => '.btn', 'function' => 'css', 'property' => 'font-size', 'units' => 'px'))));
Kirki::add_field('infinity', array('type' => 'slider', 'setting' => 'button_style_font_weight', 'label' => __('Font Weight', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 400, 'transport' => 'postMessage', 'choices' => array('min' => 100, 'max' => 900, 'step' => 100), 'output' => array('element' => '.cart_list .wc-forward,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.btn', 'property' => 'font-weight'), 'js_vars' => array(array('element' => '.btn', 'function' => 'css', 'property' => 'font-weight'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'button_style_link_color', 'label' => __('Link Color', 'infinity'), 'description' => __('Link Color', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '#ffffff', 'transport' => 'postMessage', 'output' => array('element' => '.cart_list a.wc-forward,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.eg-infinity-features-element-26 span,.btn span', 'property' => 'color'), 'js_vars' => array(array('element' => '.eg-infinity-features-element-26 span,.btn span', 'function' => 'css', 'property' => 'color'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'button_style_link_color_hover', 'description' => __('Link Color on hover', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '#ffffff', 'output' => array('element' => '.cart_list a.wc-forward:hover,.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,.eg-infinity-features-element-26::before,.btn::before', 'property' => 'color'), 'js_vars' => array(array('element' => '.btn::before', 'function' => 'css', 'property' => 'color'))));
Exemple #25
0
 */
Kirki::add_field('kirki_demo', array('type' => 'color', 'settings' => 'color_demo', 'label' => __('Color 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.', 'kirki'), 'section' => 'color_section', 'default' => '#0088cc', 'priority' => 10, 'output' => array(array('element' => 'a, a:visited', 'property' => 'color', 'units' => ' !important'), array('element' => '#content', 'property' => 'border-color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'a, a:visited', 'function' => 'css', 'property' => 'color'), array('element' => '#content', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('kirki_demo', array('type' => 'color-alpha', 'settings' => 'color_alpha_demo', 'label' => __('Color-Alpha 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.', 'kirki'), 'section' => 'color_section', 'default' => '#0088cc', 'priority' => 10, 'output' => array(array('element' => 'a, a:visited', 'property' => 'color', 'units' => ' !important'), array('element' => '#content', 'property' => 'border-color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => 'a, a:visited', 'function' => 'css', 'property' => 'color'), array('element' => '#content', 'function' => 'css', 'property' => 'background-color'))));
/**
 * Create Boolean fields using the Kirki API static functions
 */
// Checkbox
Kirki::add_field('kirki_demo', array('type' => 'checkbox', 'settings' => 'checkbox_demo_0', 'label' => __('This is the label', '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.', 'kirki'), 'section' => 'boolean_controls', 'default' => 1, 'priority' => 10));
// Switch
Kirki::add_field('kirki_demo', array('type' => 'switch', 'settings' => 'switch_demo_0', 'label' => __('This is the label', '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.', 'kirki'), 'section' => 'boolean_controls', 'default' => '1', 'priority' => 10));
Kirki::add_field('kirki_demo', array('type' => 'switch', 'settings' => 'switch_demo_1', 'label' => __('This is the label', '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.', 'kirki'), 'section' => 'boolean_controls', 'default' => '1', 'priority' => 10, 'choices' => array('round' => true)));
// Toggle
Kirki::add_field('kirki_demo', array('type' => 'toggle', 'settings' => 'toggle_demo_1', 'label' => __('This is the label', '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.', 'kirki'), 'section' => 'boolean_controls', 'default' => 1, 'priority' => 10));
/**
 * Add the background field
 */
Kirki::add_field('kirki_demo', array('type' => 'background', 'settings' => 'background_demo', 'label' => __('This is the label', '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' => 'background_section', 'default' => array('color' => '#ffffff', 'image' => '', 'repeat' => 'no-repeat', 'size' => 'cover', 'attach' => 'fixed', 'position' => 'left-top', 'opacity' => 90), 'priority' => 10, 'output' => '.hentry'));
/**
 * Configuration sample for the Kirki Customizer.
 */
function kirki_demo_configuration_sample()
{
    $args = array('color_back' => '#f7f7f7');
    return $args;
}
add_filter('kirki/config', 'kirki_demo_configuration_sample');
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' => ''));
}
Exemple #26
0
<?php

Kirki::add_section('theme_front_video', array('title' => __('Video på forsiden'), 'description' => __('Indsæt en video fra youtube på hjemmesidens forside'), 'panel' => '', 'priority' => 160, 'capability' => 'edit_theme_options', 'theme_supports' => ''));
Kirki::add_field('front_video', array('settings' => 'smamo_front_video', 'label' => __('Video url', 'smamo'), 'type' => 'url', 'section' => 'theme_front_video', 'priority' => 10, 'default' => null));
Exemple #27
0
<?php

/**
 * Nav Spacing
 * ===========
 */
$section = 'nav_spacing';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_spacing_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Main Menu</div>'));
Kirki::add_field('infinity', array('type' => 'text', 'label' => __('Link padding', 'infinity'), 'setting' => 'nav_spacing_menu_text_padding', 'section' => $section, 'priority' => $priority++, 'default' => '30px 30px 30px 30px', 'transport' => 'postMessage', 'output' => array(array('element' => '#site-navigation .menu > ul > li, #site-navigation .menu > li', 'property' => 'padding')), 'js_vars' => array(array('element' => '#site-navigation .menu > ul > li, #site-navigation .menu > li', 'function' => 'css', 'property' => 'padding'))));
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_spacing_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Sub Menu</div>'));
Kirki::add_field('infinity', array('type' => 'text', 'label' => __('Link padding', 'infinity'), 'setting' => 'nav_spacing_sub_menu_text_padding', 'section' => $section, 'priority' => $priority++, 'default' => '20px 20px 20px 20px', 'transport' => 'postMessage', 'output' => array(array('element' => '#site-navigation .sub-menu li, #site-navigation .children li', 'property' => 'padding')), 'js_vars' => array(array('element' => '#site-navigation .sub-menu li, #site-navigation .children li', 'function' => 'css', 'property' => 'padding'))));
Exemple #28
0
<?php

/**
 * Page Background
 * =========
 */
$section = 'page_bg';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'page_bg_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Title</div>'));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'page_bg_color', 'label' => __('Background color', 'infinity'), 'help' => __('Setup background color for your header', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => '#fff', 'transport' => 'postMessage', 'output' => array(array('element' => '.big-title', 'property' => 'background-color')), 'js_vars' => array(array('element' => '.big-title', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'color-alpha', 'setting' => 'page_overlay_bg_color', 'label' => __('Overlay color', 'infinity'), 'help' => __('Setup overlay color for your header', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'rgba(238,238,238,0.9)', 'output' => array(array('element' => '.big-title:after', 'property' => 'background-color')), 'js_vars' => array(array('element' => '.big-title:after', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'image', 'setting' => 'page_bg_image', 'label' => __('Background Image', 'infinity'), 'help' => __('Default background image for your header', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'http://transport.thememove.com/data/images/bg01.jpg', 'transport' => 'postMessage', 'output' => array(array('element' => '.big-title', 'property' => 'background-image')), 'js_vars' => array(array('element' => '.big-title', 'function' => 'css', 'property' => 'background-image'))));
Exemple #29
0
<?php

/**
 * Woo Layout
 * ================
 */
$section = 'woo_layout';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'radio-image', 'setting' => 'woo_layout_category', 'label' => __('Category Product Page Layout', 'infinity'), 'description' => __('Choose the category product page layout you want', 'infinity'), 'help' => __('Choose the category product page layout you want', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'sidebar-content', 'choices' => array('full-width' => THEME_ROOT . '/core/customizer/images/1c.png', 'content-sidebar' => THEME_ROOT . '/core/customizer/images/2cr.png', 'sidebar-content' => THEME_ROOT . '/core/customizer/images/2cl.png')));
Kirki::add_field('infinity', array('type' => 'radio-image', 'setting' => 'woo_layout_single_product', 'label' => __('Single Product Page Layout', 'infinity'), 'description' => __('Choose the product page layout you want', 'infinity'), 'help' => __('Choose the product page layout you want', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'sidebar-content', 'choices' => array('full-width' => THEME_ROOT . '/core/customizer/images/1c.png', 'content-sidebar' => THEME_ROOT . '/core/customizer/images/2cr.png', 'sidebar-content' => THEME_ROOT . '/core/customizer/images/2cl.png')));
Exemple #30
0
<?php

/**
 * Nav Background
 * ================
 */
$section = 'nav_bg';
$priority = 1;
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_bg_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Main Menu</div>'));
Kirki::add_field('infinity', array('type' => 'color-alpha', 'setting' => 'nav_bg_menu_background', 'label' => __('Main Background', 'infinity'), 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => secondary_color, 'transport' => 'postMessage', 'output' => array(array('element' => '.main-navigation', 'property' => 'background-color')), 'js_vars' => array(array('element' => '.main-navigation', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'color-alpha', 'setting' => 'nav_bg_menu_text_bg', 'label' => __('Link background', 'infinity'), 'description' => __('Link background', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => 'rgba(255,255,255,0.2)', 'transport' => 'postMessage', 'output' => array(array('element' => '#site-navigation .menu > ul > li:after, #site-navigation .menu > li:after', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_bg_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'help' => __('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci earum est, explicabo id illo quae!', 'infinity'), 'default' => '<div class="group_title">Sub Menu</div>'));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_bg_sub_menu_text_bg', 'label' => __('Link background', 'infinity'), 'description' => __('Link background', 'infinity'), 'section' => $section, 'priority' => $priority++, 'default' => secondary_color, 'transport' => 'postMessage', 'output' => array(array('element' => '#site-navigation .sub-menu li:after, #site-navigation .children li:after', 'property' => 'background-color')), 'js_vars' => array(array('element' => '#site-navigation .sub-menu li:after, #site-navigation .children li:after', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_bg_sub_menu_text_bg_hover', 'description' => __('Link background on hover', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => primary_color, 'output' => array(array('element' => '#site-navigation .sub-menu li:hover:after, #site-navigation .children li:hover:after', 'property' => 'background-color')), 'js_vars' => array(array('element' => '#site-navigation .sub-menu li:hover:after, #site-navigation .children li:hover:after', 'function' => 'css', 'property' => 'background-color'))));
Kirki::add_field('infinity', array('type' => 'custom', 'setting' => 'nav_bg_group_title_' . $priority++, 'section' => $section, 'priority' => $priority++, 'default' => '<div class="group_title">Mobile Menu</div>'));
Kirki::add_field('infinity', array('type' => 'color', 'setting' => 'nav_bg_mobile_menu_bg', 'description' => __('Mobile menu background', 'kirki'), 'section' => $section, 'priority' => $priority++, 'default' => primary_color, 'output' => array(array('element' => '.site-header', 'property' => 'background-color', 'prefix' => '@media ( max-width: 61.9375rem ) {', 'suffix' => '}')), 'js_vars' => array(array('element' => '.site-header', 'function' => 'css', 'property' => 'background-color'))));