Exemplo n.º 1
0
     Lessekirki::add_field('lesse', array('type' => 'text', 'settings' => sprintf('lesse_slides[%d][link]', esc_attr($key)), 'label' => esc_attr__('Link', 'lesse-lite'), 'section' => esc_attr($section)));
     Lessekirki::add_field('lesse', array('type' => 'image', 'settings' => sprintf('lesse_slides[%d][image]', esc_attr($key)), 'label' => esc_attr__('Slide Image', 'lesse-lite'), 'section' => esc_attr($section)));
 }
 /*
 |--------------------------------------------------------------------------
 | General
 |--------------------------------------------------------------------------
 */
 /*==============================
 	          Panel
 	===============================*/
 Lessekirki::add_panel('lesse_general', array('title' => esc_html__('General', 'lesse-lite'), 'description' => esc_html__('Change general settings of the theme.', 'lesse-lite')));
 /*==============================
           Sections & Fields
 	===============================*/
 Lessekirki::add_section('lesse_footer_text', array('title' => esc_attr__('Footer Copyright Text', 'lesse-lite'), 'capability' => 'edit_theme_options', 'panel' => 'lesse_general'));
 Lessekirki::add_field('lesse', array('type' => 'text', 'settings' => 'lesse_copyright_text', 'label' => esc_attr__('Copyright Text', 'lesse-lite'), 'section' => 'lesse_footer_text'));
 /*
 |--------------------------------------------------------------------------
 | WordPress Default Settings
 |--------------------------------------------------------------------------
 */
 Lessekirki::add_field('lesse', array('type' => 'image', 'settings' => 'lesse_logo', 'label' => esc_attr__('Choose Site Logo', 'lesse-lite'), 'description' => esc_attr__('Remove logo to display site title.', 'lesse-lite'), 'section' => 'title_tagline'));
 Lessekirki::add_field('lesse', array('type' => 'checkbox', 'settings' => 'lesse_hide_tagline', 'label' => esc_attr__('Hide Tagline', 'lesse-lite'), 'section' => 'title_tagline', 'default' => false));
 /*==============================
 	         	 Colors
 	===============================*/
 $palettes = apply_filters('lesse_color_palettes', array('EB4D5C' => array('#EB4D5C'), 'F34235' => array('#F34235'), 'E81D62' => array('#E81D62'), 'FF6ABE' => array('#FF6ABE'), 'FF978A' => array('#FF978A'), 'f2cbbc' => array('#f2cbbc'), '963019' => array('#963019'), '300032' => array('#300032'), '16174f' => array('#16174f'), 'C270EC' => array('#C270EC'), '9B26AF' => array('#9B26AF'), '6639B6' => array('#6639B6'), '3F51B5' => array('#3F51B5'), '6534ff' => array('#6534ff'), '2095F2' => array('#2095F2'), '03A9F4' => array('#03A9F4'), '00BBD3' => array('#00BBD3'), '01EBB6' => array('#01EBB6'), '009587' => array('#009587'), '4CAF50' => array('#4CAF50'), '8BC34A' => array('#8BC34A'), 'CCDB38' => array('#CCDB38'), 'FEEA3A' => array('#FEEA3A'), 'FEC006' => array('#FEC006'), 'f2b632' => array('#f2b632'), 'FE9700' => array('#FE9700'), 'FE5621' => array('#FE5621'), '785447' => array('#785447'), '6a5750' => array('#6a5750'), 'b5a397' => array('#b5a397'), '9D9D9D' => array('#9D9D9D'), 'bccbde' => array('#bccbde'), 'c2dde6' => array('#c2dde6'), '607D8B' => array('#607D8B'), 'e6af4b' => array('#e6af4b'), '97743a' => array('#97743a')));
 //Color Schemes
 Lessekirki::add_field('lesse', array('type' => 'palette', 'settings' => 'lesse_color_scheme', 'label' => esc_attr__('Theme Skin', 'lesse-lite'), 'description' => esc_attr__('Change color scheme.', 'lesse-lite'), 'section' => 'colors', 'default' => 'EB4D5C', 'choices' => $palettes));
 /*
<?php

if (class_exists('Lessekirki')) {
    /**
     * Add sections
     */
    Lessekirki::add_section('checkbox', array('title' => esc_attr__('Checkbox Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('text', array('title' => esc_attr__('Text Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('color', array('title' => esc_attr__('Color & Color-Alpha Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('numeric', array('title' => esc_attr__('Numeric Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('radio', array('title' => esc_attr__('Radio Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('select', array('title' => esc_attr__('Select Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('composite', array('title' => esc_attr__('Composite Controls', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    Lessekirki::add_section('custom', array('title' => esc_attr__('Custom Control', 'lesse-lite'), 'capability' => 'edit_theme_options'));
    /**
     * Add the configuration.
     * This way all the fields using the 'lesse' ID
     * will inherit these options
     */
    Lessekirki::add_config('lesse', array('capability' => 'edit_theme_options', 'option_type' => 'theme_mod'));
    /**
     * Add fields
     */
    Lessekirki::add_field('lesse', array('type' => 'checkbox', 'settings' => 'checkbox_demo', 'label' => esc_attr__('Checkbox demo', 'lesse-lite'), 'description' => esc_attr__('This is a simple checkbox', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'section' => 'checkbox', 'default' => true));
    Lessekirki::add_field('lesse', array('type' => 'switch', 'settings' => 'switch_demo', 'label' => esc_attr__('Switch demo', 'lesse-lite'), 'description' => esc_attr__('This is a switch control. Internally it is a checkbox and you can also change the ON/OFF labels.', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'section' => 'checkbox', 'default' => true, 'required' => array(array('setting' => 'checkbox_demo', 'operator' => '==', 'value' => true))));
    Lessekirki::add_field('lesse', array('type' => 'toggle', 'settings' => 'toggle_demo', 'label' => esc_attr__('Toggle demo', 'lesse-lite'), '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.', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'section' => 'checkbox', 'default' => true));
    Lessekirki::add_field('lesse', array('type' => 'text', 'settings' => 'text_demo', 'label' => esc_attr__('Text Control', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'default' => esc_attr__('This text is entered in the "text" control.', 'lesse-lite'), 'section' => 'text', 'default' => ''));
    Lessekirki::add_field('lesse', array('type' => 'textarea', 'settings' => 'textarea_demo', 'label' => esc_attr__('Textarea Control', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'default' => esc_attr__('This text is entered in the "textarea" control.', 'lesse-lite'), 'section' => 'text', 'default' => ''));
    Lessekirki::add_field('lesse', array('type' => 'editor', 'settings' => 'editor_demo', 'label' => esc_attr__('Editor Control', 'lesse-lite'), 'description' => esc_attr__('Editor Control Description', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'section' => 'text', 'default' => esc_attr__('This text is entered in the "editor" control.', 'lesse-lite')));
    Lessekirki::add_field('lesse', array('type' => 'code', 'settings' => 'code_demo', 'label' => esc_attr__('Code Control', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), '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.', 'lesse-lite'), 'section' => 'text', 'default' => 'body { background: #fff; }', 'choices' => array('language' => 'css', 'theme' => 'monokai', 'height' => 250)));
    Lessekirki::add_field('lesse', array('type' => 'color', 'settings' => 'color_demo', 'label' => esc_attr__('Color Control', 'lesse-lite'), 'description' => esc_attr__('This uses the default WordPress-core color control.', 'lesse-lite'), 'help' => esc_attr__('This is a tooltip', 'lesse-lite'), 'section' => 'color', 'default' => '#81d742', 'output' => array(array('element' => '.demo.color p', 'property' => 'color')), 'transport' => 'postMessage', 'js_vars' => array(array('element' => '.demo.color p', 'function' => 'css', 'property' => 'color'))));