@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * number Customizer Control. |
|
4 | - * |
|
5 | - * @package Kirki |
|
6 | - * @subpackage Controls |
|
7 | - * @copyright Copyright (c) 2015, Aristeides Stathopoulos |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.0 |
|
10 | - */ |
|
3 | + * number Customizer Control. |
|
4 | + * |
|
5 | + * @package Kirki |
|
6 | + * @subpackage Controls |
|
7 | + * @copyright Copyright (c) 2015, Aristeides Stathopoulos |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -7,10 +7,10 @@ |
||
7 | 7 | die( 'File can\'t be accessed directly' ); |
8 | 8 | } |
9 | 9 | /** |
10 | - * Make sure we set the correct MIME type |
|
11 | - */ |
|
10 | + * Make sure we set the correct MIME type |
|
11 | + */ |
|
12 | 12 | header( 'Content-Type: text/css' ); |
13 | 13 | /** |
14 | - * Echo the styles |
|
15 | - */ |
|
14 | + * Echo the styles |
|
15 | + */ |
|
16 | 16 | echo Kirki_Styles_Frontend::loop_controls(); |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Color Calculations class for Kirki |
|
4 | - * Initially built for the Shoestrap-3 theme and then tweaked for Kirki. |
|
5 | - * |
|
6 | - * @package Kirki |
|
7 | - * @category Core |
|
8 | - * @author Aristeides Stathopoulos |
|
9 | - * @copyright Copyright (c) 2015, Aristeides Stathopoulos |
|
10 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
11 | - * @since 1.0 |
|
12 | - */ |
|
3 | + * Color Calculations class for Kirki |
|
4 | + * Initially built for the Shoestrap-3 theme and then tweaked for Kirki. |
|
5 | + * |
|
6 | + * @package Kirki |
|
7 | + * @category Core |
|
8 | + * @author Aristeides Stathopoulos |
|
9 | + * @copyright Copyright (c) 2015, Aristeides Stathopoulos |
|
10 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
11 | + * @since 1.0 |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | // Exit if accessed directly |
15 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -98,7 +98,7 @@ |
||
98 | 98 | * |
99 | 99 | * @param string The rgba color formatted like rgba(r,g,b,a) |
100 | 100 | * |
101 | - * @return string The alpha value of the color. |
|
101 | + * @return integer The alpha value of the color. |
|
102 | 102 | */ |
103 | 103 | public static function get_alpha_from_rgba( $color ) { |
104 | 104 | $obj = kirki_wp_color( $color ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * Build the field. |
88 | 88 | * We're merging with the original field here, so any extra properties are inherited. |
89 | 89 | */ |
90 | - $fields[ $property_setting ] = array_merge( $field, array( |
|
90 | + $fields[$property_setting] = array_merge( $field, array( |
|
91 | 91 | 'type' => $type, |
92 | 92 | 'label' => $label, |
93 | 93 | 'settings' => $property_setting, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'description' => $description, |
99 | 99 | 'default' => $value, |
100 | 100 | 'id' => Kirki_Field_Sanitize::sanitize_id( array( 'settings' => Kirki_Field_Sanitize::sanitize_settings( array( 'settings' => $field['settings'] . '_' . $setting ) ) ) ), |
101 | - 'choices' => isset( $choices[ $key ] ) ? $choices[ $key ] : array(), |
|
101 | + 'choices' => isset( $choices[$key] ) ? $choices[$key] : array(), |
|
102 | 102 | 'output' => ( '' != $field['output'] ) ? array( |
103 | 103 | array( |
104 | 104 | 'element' => $field['output'], |
@@ -50,9 +50,9 @@ |
||
50 | 50 | // Make sure that every row is an array, not an object |
51 | 51 | foreach ( $sanitized as $key => $_value ) { |
52 | 52 | if ( empty( $_value ) ) { |
53 | - unset( $sanitized[ $key ] ); |
|
53 | + unset( $sanitized[$key] ); |
|
54 | 54 | } else { |
55 | - $sanitized[ $key ] = (array) $_value; |
|
55 | + $sanitized[$key] = (array) $_value; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Repeater Customizer Setting. |
|
4 | - * |
|
5 | - * @package Kirki |
|
6 | - * @subpackage Controls |
|
7 | - * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.0 |
|
10 | - */ |
|
3 | + * Repeater Customizer Setting. |
|
4 | + * |
|
5 | + * @package Kirki |
|
6 | + * @subpackage Controls |
|
7 | + * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -15,11 +15,11 @@ |
||
15 | 15 | $fields = Kirki::$fields; |
16 | 16 | |
17 | 17 | // Make sure the current object matches a registered field. |
18 | - if ( ! isset( $object->setting->id ) || ! isset( $fields[ $object->setting->id ] ) ) { |
|
18 | + if ( ! isset( $object->setting->id ) || ! isset( $fields[$object->setting->id] ) ) { |
|
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | |
22 | - $current_object = $fields[ $object->setting->id ]; |
|
22 | + $current_object = $fields[$object->setting->id]; |
|
23 | 23 | |
24 | 24 | if ( isset( $current_object['required'] ) ) { |
25 | 25 |
@@ -26,18 +26,18 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * fallback to 'global' if $config_id is not found |
28 | 28 | */ |
29 | - if ( ! isset( Kirki::$config[ $config_id ] ) ) { |
|
29 | + if ( ! isset( Kirki::$config[$config_id] ) ) { |
|
30 | 30 | $config_id = 'global'; |
31 | 31 | } |
32 | 32 | |
33 | - if ( 'theme_mod' == Kirki::$config[ $config_id ]['option_type'] ) { |
|
33 | + if ( 'theme_mod' == Kirki::$config[$config_id]['option_type'] ) { |
|
34 | 34 | /** |
35 | 35 | * We're using theme_mods. |
36 | 36 | * so just get the value using get_theme_mod |
37 | 37 | */ |
38 | 38 | $default_value = null; |
39 | - if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['default'] ) ) { |
|
40 | - $default_value = Kirki::$fields[ $field_id ]['default']; |
|
39 | + if ( isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[$field_id]['default'] ) ) { |
|
40 | + $default_value = Kirki::$fields[$field_id]['default']; |
|
41 | 41 | } |
42 | 42 | $value = get_theme_mod( $field_id, $default_value ); |
43 | 43 | |
@@ -45,51 +45,51 @@ discard block |
||
45 | 45 | * If the field is a background field, then get the sub-fields |
46 | 46 | * and return an array of the values. |
47 | 47 | */ |
48 | - if ( isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ $field_id ]['type'] ) && 'background' == Kirki::$fields[ $field_id ]['type'] ) { |
|
48 | + if ( isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[$field_id]['type'] ) && 'background' == Kirki::$fields[$field_id]['type'] ) { |
|
49 | 49 | $value = array(); |
50 | 50 | if ( null == $default_value ) { |
51 | 51 | $default_value = array(); |
52 | 52 | } |
53 | 53 | foreach ( $default_value as $property_key => $property_default ) { |
54 | - $value[ $property_key ] = get_theme_mod( $field_id . '_' . $property_key, $property_default ); |
|
54 | + $value[$property_key] = get_theme_mod( $field_id . '_' . $property_key, $property_default ); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | - } elseif ( 'option' == Kirki::$config[ $config_id ]['option_type'] ) { |
|
58 | + } elseif ( 'option' == Kirki::$config[$config_id]['option_type'] ) { |
|
59 | 59 | /** |
60 | 60 | * We're using options. |
61 | 61 | */ |
62 | - if ( '' != Kirki::$config[ $config_id ]['option_name'] ) { |
|
62 | + if ( '' != Kirki::$config[$config_id]['option_name'] ) { |
|
63 | 63 | /** |
64 | 64 | * Options are serialized as a single option in the db. |
65 | 65 | * We'll have to get the option and then get the item from the array. |
66 | 66 | */ |
67 | - $options = get_option( Kirki::$config[ $config_id ]['option_name'] ); |
|
67 | + $options = get_option( Kirki::$config[$config_id]['option_name'] ); |
|
68 | 68 | |
69 | - if ( ! isset( Kirki::$fields[ $field_id ] ) && isset( Kirki::$fields[ Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']'] ) ) { |
|
70 | - $field_id = Kirki::$config[ $config_id ]['option_name'] . '[' . $field_id . ']'; |
|
69 | + if ( ! isset( Kirki::$fields[$field_id] ) && isset( Kirki::$fields[Kirki::$config[$config_id]['option_name'] . '[' . $field_id . ']'] ) ) { |
|
70 | + $field_id = Kirki::$config[$config_id]['option_name'] . '[' . $field_id . ']'; |
|
71 | 71 | } |
72 | - $setting_modified = str_replace( ']', '', str_replace( Kirki::$config[ $config_id ]['option_name'] . '[', '', $field_id ) ); |
|
72 | + $setting_modified = str_replace( ']', '', str_replace( Kirki::$config[$config_id]['option_name'] . '[', '', $field_id ) ); |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * If this is a background field, get the individual sub-fields and return an array. |
76 | 76 | */ |
77 | - if ( 'background' == Kirki::$fields[ $field_id ]['type'] ) { |
|
77 | + if ( 'background' == Kirki::$fields[$field_id]['type'] ) { |
|
78 | 78 | $value = array(); |
79 | 79 | |
80 | - foreach ( Kirki::$fields[ $field_id ]['default'] as $property => $property_default ) { |
|
80 | + foreach ( Kirki::$fields[$field_id]['default'] as $property => $property_default ) { |
|
81 | 81 | |
82 | - if ( isset( $options[ $setting_modified . '_' . $property ] ) ) { |
|
83 | - $value[ $property ] = $options[ $setting_modified . '_' . $property ]; |
|
82 | + if ( isset( $options[$setting_modified . '_' . $property] ) ) { |
|
83 | + $value[$property] = $options[$setting_modified . '_' . $property]; |
|
84 | 84 | } else { |
85 | - $value[ $property ] = $property_default; |
|
85 | + $value[$property] = $property_default; |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | } else { |
89 | 89 | /** |
90 | 90 | * This is not a background field so continue and get the value. |
91 | 91 | */ |
92 | - $value = ( isset( $options[ $setting_modified ] ) ) ? $options[ $setting_modified ] : Kirki::$fields[ $field_id ]['default']; |
|
92 | + $value = ( isset( $options[$setting_modified] ) ) ? $options[$setting_modified] : Kirki::$fields[$field_id]['default']; |
|
93 | 93 | $value = maybe_unserialize( $value ); |
94 | 94 | } |
95 | 95 | |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | /** |
98 | 98 | * Each option separately saved in the db |
99 | 99 | */ |
100 | - $value = get_option( $field_id, Kirki::$fields[ $field_id ]['default'] ); |
|
100 | + $value = get_option( $field_id, Kirki::$fields[$field_id]['default'] ); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * If the field is a background field, then get the sub-fields |
104 | 104 | * and return an array of the values. |
105 | 105 | */ |
106 | - if ( 'background' == Kirki::$fields[ $field_id ]['type'] ) { |
|
106 | + if ( 'background' == Kirki::$fields[$field_id]['type'] ) { |
|
107 | 107 | $value = array(); |
108 | - foreach ( Kirki::$fields[ $field_id ]['default'] as $property_key => $property_default ) { |
|
109 | - $value[ $property_key ] = get_option( $field_id . '_' . $property_key, $property_default ); |
|
108 | + foreach ( Kirki::$fields[$field_id]['default'] as $property_key => $property_default ) { |
|
109 | + $value[$property_key] = get_option( $field_id . '_' . $property_key, $property_default ); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | if ( isset( $field['option_name'] ) && '' != $field['option_name'] ) { |
130 | 130 | $all_values = get_option( $field['option_name'], array() ); |
131 | 131 | $sub_setting_id = str_replace( array( ']', $field['option_name'] . '[' ), '', $field['settings'] ); |
132 | - if ( isset( $all_values[ $sub_setting_id ] ) ) { |
|
133 | - $value = $all_values[ $sub_setting_id ]; |
|
132 | + if ( isset( $all_values[$sub_setting_id] ) ) { |
|
133 | + $value = $all_values[$sub_setting_id]; |
|
134 | 134 | } |
135 | 135 | } else { |
136 | 136 | $value = get_option( $field['settings'], $field['default'] ); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package Kirki |
|
4 | - * @subpackage Controls |
|
5 | - * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
6 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
7 | - * @since 1.0 |
|
8 | - */ |
|
3 | + * @package Kirki |
|
4 | + * @subpackage Controls |
|
5 | + * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
6 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
7 | + * @since 1.0 |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | // Exit if accessed directly |
11 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Enqueue the scripts that are required by the customizer. |
|
4 | - * Any additional scripts that are required by individual controls |
|
5 | - * are enqueued in the control classes themselves. |
|
6 | - * |
|
7 | - * @package Kirki |
|
8 | - * @category Core |
|
9 | - * @author Aristeides Stathopoulos |
|
10 | - * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
11 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
12 | - * @since 1.0 |
|
13 | - */ |
|
3 | + * Enqueue the scripts that are required by the customizer. |
|
4 | + * Any additional scripts that are required by individual controls |
|
5 | + * are enqueued in the control classes themselves. |
|
6 | + * |
|
7 | + * @package Kirki |
|
8 | + * @category Core |
|
9 | + * @author Aristeides Stathopoulos |
|
10 | + * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
11 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
12 | + * @since 1.0 |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | // Exit if accessed directly |
16 | 16 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | 'family' => $value['stack'], |
75 | 75 | 'label' => $value['label'], |
76 | 76 | 'variants' => array( |
77 | - array( 'id' => 'regular', 'label' => $all_variants['regular'] ), |
|
78 | - array( 'id' => 'italic', 'label' => $all_variants['italic'] ), |
|
79 | - array( 'id' => '700', 'label' => $all_variants['700'] ), |
|
77 | + array( 'id' => 'regular', 'label' => $all_variants['regular'] ), |
|
78 | + array( 'id' => 'italic', 'label' => $all_variants['italic'] ), |
|
79 | + array( 'id' => '700', 'label' => $all_variants['700'] ), |
|
80 | 80 | array( 'id' => '700italic', 'label' => $all_variants['700italic'] ), |
81 | 81 | ), |
82 | 82 | 'subsets' => array(), |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $available_variants = array(); |
94 | 94 | foreach ( $variants as $variant ) { |
95 | 95 | if ( array_key_exists( $variant, $all_variants ) ) { |
96 | - $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[ $variant ] ); |
|
96 | + $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[$variant] ); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | 100 | $available_subsets = array(); |
101 | 101 | foreach ( $subsets as $subset ) { |
102 | 102 | if ( array_key_exists( $subset, $all_subsets ) ) { |
103 | - $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[ $subset ] ); |
|
103 | + $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[$subset] ); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 |