@@ -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(); |
@@ -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'], |
@@ -46,8 +46,9 @@ |
||
| 46 | 46 | parent::to_json(); |
| 47 | 47 | |
| 48 | 48 | $this->json['choicesLength'] = 0; |
| 49 | - if ( is_array( $this->choices ) && count( $this->choices ) ) |
|
| 50 | - $this->json['choicesLength'] = count( $this->choices ); |
|
| 49 | + if ( is_array( $this->choices ) && count( $this->choices ) ) { |
|
| 50 | + $this->json['choicesLength'] = count( $this->choices ); |
|
| 51 | + } |
|
| 51 | 52 | |
| 52 | 53 | $values = $this->value() == '' ? array_keys( $this->choices ) : $this->value(); |
| 53 | 54 | $filtered_values = array(); |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * sortable Customizer Control. |
|
| 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 | + * sortable Customizer Control. |
|
| 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' ) ) { |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $class_name = 'WP_Customize_Control'; |
| 80 | 80 | // Get the classname from the array of control classnames |
| 81 | 81 | if ( array_key_exists( $args['type'], self::$control_types ) ) { |
| 82 | - $class_name = self::$control_types[ $args['type'] ]; |
|
| 82 | + $class_name = self::$control_types[$args['type']]; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | return $class_name; |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | return $array; |
| 27 | 27 | } |
| 28 | 28 | for ( $i = 1; $i < count( $args ); $i++ ) { |
| 29 | - if ( is_array( $args[ $i ] ) ) { |
|
| 30 | - $array = self::recurse( $array, $args[ $i ] ); |
|
| 29 | + if ( is_array( $args[$i] ) ) { |
|
| 30 | + $array = self::recurse( $array, $args[$i] ); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | return $array; |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | public static function recurse( $array, $array1 ) { |
| 37 | 37 | foreach ( $array1 as $key => $value ) { |
| 38 | 38 | // create new key in $array, if it is empty or not an array |
| 39 | - if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { |
|
| 40 | - $array[ $key ] = array(); |
|
| 39 | + if ( ! isset( $array[$key] ) || ( isset( $array[$key] ) && ! is_array( $array[$key] ) ) ) { |
|
| 40 | + $array[$key] = array(); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // overwrite the value in the base array |
| 44 | 44 | if ( is_array( $value ) ) { |
| 45 | - $value = self::recurse( $array[ $key ], $value ); |
|
| 45 | + $value = self::recurse( $array[$key], $value ); |
|
| 46 | 46 | } |
| 47 | - $array[ $key ] = $value; |
|
| 47 | + $array[$key] = $value; |
|
| 48 | 48 | } |
| 49 | 49 | return $array; |
| 50 | 50 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | return null; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - unset( $array[ $idx ] ); |
|
| 75 | + unset( $array[$idx] ); |
|
| 76 | 76 | return array_values( $array ); |
| 77 | 77 | |
| 78 | 78 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | // properly format the array. |
| 133 | 133 | $items = array(); |
| 134 | 134 | foreach ( $posts as $post ) { |
| 135 | - $items[ $post->ID ] = $post->post_title; |
|
| 135 | + $items[$post->ID] = $post->post_title; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return $items; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | foreach ( $taxonomies as $taxonomy ) { |
| 150 | 150 | $id = $taxonomy; |
| 151 | 151 | $taxonomy = get_taxonomy( $taxonomy ); |
| 152 | - $items[ $id ] = $taxonomy->labels->name; |
|
| 152 | + $items[$id] = $taxonomy->labels->name; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return $items; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
| 165 | 165 | // Build the array |
| 166 | 166 | foreach ( $post_types as $post_type ) { |
| 167 | - $items[ $post_type->name ] = $post_type->labels->name; |
|
| 167 | + $items[$post_type->name] = $post_type->labels->name; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | return $items; |
@@ -80,11 +80,14 @@ |
||
| 80 | 80 | public static function array_flatten( array $array ) { |
| 81 | 81 | $flat = array(); // initialize return array |
| 82 | 82 | $stack = array_values( $array ); |
| 83 | - while ( $stack ) { // process stack until done |
|
| 83 | + while ( $stack ) { |
|
| 84 | +// process stack until done |
|
| 84 | 85 | $value = array_shift( $stack ); |
| 85 | - if ( is_array( $value ) ) { // a value to further process |
|
| 86 | + if ( is_array( $value ) ) { |
|
| 87 | +// a value to further process |
|
| 86 | 88 | $stack = array_merge( array_keys( $value ), $stack ); |
| 87 | - } else { // a value to take |
|
| 89 | + } else { |
|
| 90 | +// a value to take |
|
| 88 | 91 | $flat[] = $value; |
| 89 | 92 | } |
| 90 | 93 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - self::$panels[ $args['id'] ] = $args; |
|
| 70 | + self::$panels[$args['id']] = $args; |
|
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true'; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - self::$sections[ $args['id'] ] = $args; |
|
| 91 | + self::$sections[$args['id']] = $args; |
|
| 92 | 92 | |
| 93 | 93 | } |
| 94 | 94 | |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The Kirki API class. |
|
| 4 | - * Takes care of adding panels, sections & fields to the customizer. |
|
| 5 | - * For documentation please see https://github.com/aristath/kirki/wiki |
|
| 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 | + * The Kirki API class. |
|
| 4 | + * Takes care of adding panels, sections & fields to the customizer. |
|
| 5 | + * For documentation please see https://github.com/aristath/kirki/wiki |
|
| 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' ) ) { |
@@ -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' ) ) { |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | // Allow empty value as the config ID by setting the id to global. |
| 47 | 47 | $config_id = ( '' == $config_id ) ? 'global' : $config_id; |
| 48 | 48 | // Set the config |
| 49 | - Kirki::$config[ $config_id ] = array_merge( $this->default_args, $args ); |
|
| 49 | + Kirki::$config[$config_id] = array_merge( $this->default_args, $args ); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |