@@ -12,12 +12,12 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // Exit if accessed directly. |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | - exit; |
|
| 15 | + exit; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // Do not proceed if Kirki does not exist. |
| 19 | 19 | if ( ! class_exists( 'Kirki' ) ) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @link https://aristath.github.io/kirki/docs/getting-started/config.html |
| 27 | 27 | */ |
| 28 | 28 | Kirki::add_config( 'kirki_demo', array( |
| 29 | - 'capability' => 'edit_theme_options', |
|
| 29 | + 'capability' => 'edit_theme_options', |
|
| 30 | 30 | 'option_type' => 'theme_mod', |
| 31 | 31 | ) ); |
| 32 | 32 | |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * @link https://aristath.github.io/kirki/docs/getting-started/panels.html |
| 37 | 37 | */ |
| 38 | 38 | Kirki::add_panel( 'kirki_demo_panel', array( |
| 39 | - 'priority' => 10, |
|
| 40 | - 'title' => esc_attr__( 'Kirki Demo Panel', 'textdomain' ), |
|
| 41 | - 'description' => esc_attr__( 'Contains sections for all kirki controls.', 'textdomain' ), |
|
| 39 | + 'priority' => 10, |
|
| 40 | + 'title' => esc_attr__( 'Kirki Demo Panel', 'textdomain' ), |
|
| 41 | + 'description' => esc_attr__( 'Contains sections for all kirki controls.', 'textdomain' ), |
|
| 42 | 42 | ) ); |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -50,61 +50,61 @@ discard block |
||
| 50 | 50 | * @link https://aristath.github.io/kirki/docs/getting-started/sections.html |
| 51 | 51 | */ |
| 52 | 52 | $sections = array( |
| 53 | - 'background' => array( esc_attr__( 'Background', 'textdomain' ), '' ), |
|
| 54 | - 'code' => array( esc_attr__( 'Code', 'textdomain' ), '' ), |
|
| 55 | - 'checkbox' => array( esc_attr__( 'Checkbox', 'textdomain' ), '' ), |
|
| 56 | - 'color' => array( esc_attr__( 'Color', 'textdomain' ), '' ), |
|
| 57 | - 'color-palette' => array( esc_attr__( 'Color Palette', 'textdomain' ), '' ), |
|
| 58 | - 'custom' => array( esc_attr__( 'Custom', 'textdomain' ), '' ), |
|
| 59 | - 'dashicons' => array( esc_attr__( 'Dashicons', 'textdomain' ), '' ), |
|
| 60 | - 'date' => array( esc_attr__( 'Date', 'textdomain' ), '' ), |
|
| 61 | - 'dimension' => array( esc_attr__( 'Dimension', 'textdomain' ), '' ), |
|
| 62 | - 'dimensions' => array( esc_attr__( 'Dimensions', 'textdomain' ), '' ), |
|
| 63 | - 'editor' => array( esc_attr__( 'Editor', 'textdomain' ), '' ), |
|
| 64 | - 'fontawesome' => array( esc_attr__( 'Font-Awesome', 'textdomain' ), '' ), |
|
| 65 | - 'generic' => array( esc_attr__( 'Generic', 'textdomain' ), '' ), |
|
| 66 | - 'image' => array( esc_attr__( 'Image', 'textdomain' ), '' ), |
|
| 67 | - 'multicheck' => array( esc_attr__( 'Multicheck', 'textdomain' ), '' ), |
|
| 68 | - 'multicolor' => array( esc_attr__( 'Multicolor', 'textdomain' ), '' ), |
|
| 69 | - 'number' => array( esc_attr__( 'Number', 'textdomain' ), '' ), |
|
| 70 | - 'palette' => array( esc_attr__( 'Palette', 'textdomain' ), '' ), |
|
| 71 | - 'preset' => array( esc_attr__( 'Preset', 'textdomain' ), '' ), |
|
| 72 | - 'radio' => array( esc_attr__( 'Radio', 'textdomain' ), esc_attr__( 'A plain Radio control.', 'textdomain' ) ), |
|
| 73 | - 'radio-buttonset' => array( esc_attr__( 'Radio Buttonset', 'textdomain' ), esc_attr__( 'Radio-Buttonset controls are essentially radio controls with some fancy styling to make them look cooler.', 'textdomain' ) ), |
|
| 74 | - 'radio-image' => array( esc_attr__( 'Radio Image', 'textdomain' ), esc_attr__( 'Radio-Image controls are essentially radio controls with some fancy styles to use images', 'textdomain' ) ), |
|
| 75 | - 'repeater' => array( esc_attr__( 'Repeater', 'textdomain' ), '' ), |
|
| 76 | - 'select' => array( esc_attr__( 'Select', 'textdomain' ), '' ), |
|
| 77 | - 'slider' => array( esc_attr__( 'Slider', 'textdomain' ), '' ), |
|
| 78 | - 'sortable' => array( esc_attr__( 'Sortable', 'textdomain' ), '' ), |
|
| 79 | - 'switch' => array( esc_attr__( 'Switch', 'textdomain' ), '' ), |
|
| 80 | - 'toggle' => array( esc_attr__( 'Toggle', 'textdomain' ), '' ), |
|
| 81 | - 'typography' => array( esc_attr__( 'Typography', 'textdomain' ), '' ), |
|
| 53 | + 'background' => array( esc_attr__( 'Background', 'textdomain' ), '' ), |
|
| 54 | + 'code' => array( esc_attr__( 'Code', 'textdomain' ), '' ), |
|
| 55 | + 'checkbox' => array( esc_attr__( 'Checkbox', 'textdomain' ), '' ), |
|
| 56 | + 'color' => array( esc_attr__( 'Color', 'textdomain' ), '' ), |
|
| 57 | + 'color-palette' => array( esc_attr__( 'Color Palette', 'textdomain' ), '' ), |
|
| 58 | + 'custom' => array( esc_attr__( 'Custom', 'textdomain' ), '' ), |
|
| 59 | + 'dashicons' => array( esc_attr__( 'Dashicons', 'textdomain' ), '' ), |
|
| 60 | + 'date' => array( esc_attr__( 'Date', 'textdomain' ), '' ), |
|
| 61 | + 'dimension' => array( esc_attr__( 'Dimension', 'textdomain' ), '' ), |
|
| 62 | + 'dimensions' => array( esc_attr__( 'Dimensions', 'textdomain' ), '' ), |
|
| 63 | + 'editor' => array( esc_attr__( 'Editor', 'textdomain' ), '' ), |
|
| 64 | + 'fontawesome' => array( esc_attr__( 'Font-Awesome', 'textdomain' ), '' ), |
|
| 65 | + 'generic' => array( esc_attr__( 'Generic', 'textdomain' ), '' ), |
|
| 66 | + 'image' => array( esc_attr__( 'Image', 'textdomain' ), '' ), |
|
| 67 | + 'multicheck' => array( esc_attr__( 'Multicheck', 'textdomain' ), '' ), |
|
| 68 | + 'multicolor' => array( esc_attr__( 'Multicolor', 'textdomain' ), '' ), |
|
| 69 | + 'number' => array( esc_attr__( 'Number', 'textdomain' ), '' ), |
|
| 70 | + 'palette' => array( esc_attr__( 'Palette', 'textdomain' ), '' ), |
|
| 71 | + 'preset' => array( esc_attr__( 'Preset', 'textdomain' ), '' ), |
|
| 72 | + 'radio' => array( esc_attr__( 'Radio', 'textdomain' ), esc_attr__( 'A plain Radio control.', 'textdomain' ) ), |
|
| 73 | + 'radio-buttonset' => array( esc_attr__( 'Radio Buttonset', 'textdomain' ), esc_attr__( 'Radio-Buttonset controls are essentially radio controls with some fancy styling to make them look cooler.', 'textdomain' ) ), |
|
| 74 | + 'radio-image' => array( esc_attr__( 'Radio Image', 'textdomain' ), esc_attr__( 'Radio-Image controls are essentially radio controls with some fancy styles to use images', 'textdomain' ) ), |
|
| 75 | + 'repeater' => array( esc_attr__( 'Repeater', 'textdomain' ), '' ), |
|
| 76 | + 'select' => array( esc_attr__( 'Select', 'textdomain' ), '' ), |
|
| 77 | + 'slider' => array( esc_attr__( 'Slider', 'textdomain' ), '' ), |
|
| 78 | + 'sortable' => array( esc_attr__( 'Sortable', 'textdomain' ), '' ), |
|
| 79 | + 'switch' => array( esc_attr__( 'Switch', 'textdomain' ), '' ), |
|
| 80 | + 'toggle' => array( esc_attr__( 'Toggle', 'textdomain' ), '' ), |
|
| 81 | + 'typography' => array( esc_attr__( 'Typography', 'textdomain' ), '' ), |
|
| 82 | 82 | ); |
| 83 | 83 | foreach ( $sections as $section_id => $section ) { |
| 84 | - Kirki::add_section( $section_id . '_section', array( |
|
| 85 | - 'title' => $section[0], |
|
| 86 | - 'description' => $section[1], |
|
| 87 | - 'panel' => 'kirki_demo_panel', |
|
| 88 | - ) ); |
|
| 84 | + Kirki::add_section( $section_id . '_section', array( |
|
| 85 | + 'title' => $section[0], |
|
| 86 | + 'description' => $section[1], |
|
| 87 | + 'panel' => 'kirki_demo_panel', |
|
| 88 | + ) ); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | 92 | * Background Control. |
| 93 | 93 | */ |
| 94 | 94 | Kirki::add_field( 'kirki_demo', array( |
| 95 | - 'type' => 'background', |
|
| 96 | - 'settings' => 'background_setting', |
|
| 97 | - 'label' => esc_attr__( 'Background Control', 'textdomain' ), |
|
| 98 | - 'description' => esc_attr__( 'Background conrols are pretty complex! (but useful if properly used)', 'textdomain' ), |
|
| 99 | - 'section' => 'background_section', |
|
| 100 | - 'default' => array( |
|
| 101 | - 'background-color' => 'rgba(20,20,20,.8)', |
|
| 102 | - 'background-image' => '', |
|
| 103 | - 'background-repeat' => 'repeat-all', |
|
| 104 | - 'background-position' => 'center center', |
|
| 105 | - 'background-size' => 'cover', |
|
| 106 | - 'background-attachment' => 'scroll', |
|
| 107 | - ), |
|
| 95 | + 'type' => 'background', |
|
| 96 | + 'settings' => 'background_setting', |
|
| 97 | + 'label' => esc_attr__( 'Background Control', 'textdomain' ), |
|
| 98 | + 'description' => esc_attr__( 'Background conrols are pretty complex! (but useful if properly used)', 'textdomain' ), |
|
| 99 | + 'section' => 'background_section', |
|
| 100 | + 'default' => array( |
|
| 101 | + 'background-color' => 'rgba(20,20,20,.8)', |
|
| 102 | + 'background-image' => '', |
|
| 103 | + 'background-repeat' => 'repeat-all', |
|
| 104 | + 'background-position' => 'center center', |
|
| 105 | + 'background-size' => 'cover', |
|
| 106 | + 'background-attachment' => 'scroll', |
|
| 107 | + ), |
|
| 108 | 108 | ) ); |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -113,16 +113,16 @@ discard block |
||
| 113 | 113 | * @link https://aristath.github.io/kirki/docs/controls/code.html |
| 114 | 114 | */ |
| 115 | 115 | Kirki::add_field( 'kirki_demo', array( |
| 116 | - 'type' => 'code', |
|
| 117 | - 'settings' => 'code_setting', |
|
| 118 | - 'label' => esc_attr__( 'Code Control', 'textdomain' ), |
|
| 119 | - 'description' => esc_attr__( 'Description', 'textdomain' ), |
|
| 120 | - 'section' => 'code_section', |
|
| 121 | - 'default' => '', |
|
| 122 | - 'choices' => array( |
|
| 123 | - 'language' => 'css', |
|
| 124 | - 'theme' => 'monokai', |
|
| 125 | - ), |
|
| 116 | + 'type' => 'code', |
|
| 117 | + 'settings' => 'code_setting', |
|
| 118 | + 'label' => esc_attr__( 'Code Control', 'textdomain' ), |
|
| 119 | + 'description' => esc_attr__( 'Description', 'textdomain' ), |
|
| 120 | + 'section' => 'code_section', |
|
| 121 | + 'default' => '', |
|
| 122 | + 'choices' => array( |
|
| 123 | + 'language' => 'css', |
|
| 124 | + 'theme' => 'monokai', |
|
| 125 | + ), |
|
| 126 | 126 | ) ); |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | * @link https://aristath.github.io/kirki/docs/controls/checkbox.html |
| 132 | 132 | */ |
| 133 | 133 | Kirki::add_field( 'kirki_demo', array( |
| 134 | - 'type' => 'checkbox', |
|
| 135 | - 'settings' => 'checkbox_setting', |
|
| 136 | - 'label' => esc_attr__( 'Checkbox Control', 'textdomain' ), |
|
| 137 | - 'description' => esc_attr__( 'Description', 'textdomain' ), |
|
| 138 | - 'section' => 'checkbox_section', |
|
| 139 | - 'default' => true, |
|
| 134 | + 'type' => 'checkbox', |
|
| 135 | + 'settings' => 'checkbox_setting', |
|
| 136 | + 'label' => esc_attr__( 'Checkbox Control', 'textdomain' ), |
|
| 137 | + 'description' => esc_attr__( 'Description', 'textdomain' ), |
|
| 138 | + 'section' => 'checkbox_section', |
|
| 139 | + 'default' => true, |
|
| 140 | 140 | ) ); |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | 'type' => 'color', |
| 149 | 149 | 'settings' => 'color_setting_hex', |
| 150 | 150 | 'label' => __( 'Color Control (hex-only)', 'textdomain' ), |
| 151 | - 'description' => esc_attr__( 'This is a color control - without alpha channel.', 'textdomain' ), |
|
| 151 | + 'description' => esc_attr__( 'This is a color control - without alpha channel.', 'textdomain' ), |
|
| 152 | 152 | 'section' => 'color_section', |
| 153 | 153 | 'default' => '#0088CC', |
| 154 | 154 | ) ); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'type' => 'color', |
| 158 | 158 | 'settings' => 'color_setting_rgba', |
| 159 | 159 | 'label' => __( 'Color Control (with alpha channel)', 'textdomain' ), |
| 160 | - 'description' => esc_attr__( 'This is a color control - with alpha channel.', 'textdomain' ), |
|
| 160 | + 'description' => esc_attr__( 'This is a color control - with alpha channel.', 'textdomain' ), |
|
| 161 | 161 | 'section' => 'color_section', |
| 162 | 162 | 'default' => '#0088CC', |
| 163 | 163 | 'choices' => array( |