@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | foreach ( $args as $key => $value ) { |
| 85 | 85 | // Is this property whitelisted? |
| 86 | 86 | if ( property_exists( $this, $key ) ) { |
| 87 | - $args[ $key ] = $value; |
|
| 87 | + $args[$key] = $value; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $id = ( '' == $id ) ? 'global' : $id; |
| 123 | 123 | |
| 124 | 124 | $id_md5 = md5( $id ); |
| 125 | - if ( ! isset( self::$instances[ $id_md5 ] ) ) { |
|
| 126 | - self::$instances[ $id_md5 ] = new self( $id, $args ); |
|
| 125 | + if ( ! isset( self::$instances[$id_md5] ) ) { |
|
| 126 | + self::$instances[$id_md5] = new self( $id, $args ); |
|
| 127 | 127 | } |
| 128 | - return self::$instances[ $id_md5 ]; |
|
| 128 | + return self::$instances[$id_md5]; |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | // Get defaults from the class |
| 169 | 169 | $defaults = get_class_vars( __CLASS__ ); |
| 170 | 170 | // Get the config arguments, and merge them with the defaults |
| 171 | - $config_defaults = Kirki::$config[ $this->kirki_config ]; |
|
| 171 | + $config_defaults = Kirki::$config[$this->kirki_config]; |
|
| 172 | 172 | foreach ( $config_defaults as $key => $value ) { |
| 173 | - if ( isset( $defaults[ $key ] ) ) { |
|
| 174 | - if ( ! empty( $value ) && $value != $defaults[ $key ] ) { |
|
| 175 | - $defaults[ $key ] = $value; |
|
| 173 | + if ( isset( $defaults[$key] ) ) { |
|
| 174 | + if ( ! empty( $value ) && $value != $defaults[$key] ) { |
|
| 175 | + $defaults[$key] = $value; |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | // remove any whitelisted properties from above |
| 202 | 202 | // These will get a free pass, completely unfiltered. |
| 203 | 203 | foreach ( $whitelisted_properties as $key => $default_value ) { |
| 204 | - if ( isset( $properties[ $key ] ) ) { |
|
| 205 | - unset( $properties[ $key ] ); |
|
| 204 | + if ( isset( $properties[$key] ) ) { |
|
| 205 | + unset( $properties[$key] ); |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | // Some things must run before the others. |
@@ -231,18 +231,18 @@ discard block |
||
| 231 | 231 | // Get all arguments with their values |
| 232 | 232 | $args = get_class_vars( __CLASS__ ); |
| 233 | 233 | foreach ( $args as $key => $default_value ) { |
| 234 | - $args[ $key ] = $this->$key; |
|
| 234 | + $args[$key] = $this->$key; |
|
| 235 | 235 | } |
| 236 | 236 | // add the whitelisted properties through the back door |
| 237 | 237 | foreach ( $whitelisted_properties as $key => $default_value ) { |
| 238 | 238 | if ( ! isset( $this->$key ) ) { |
| 239 | 239 | $this->$key = $default_value; |
| 240 | 240 | } |
| 241 | - $args[ $key ] = $this->$key; |
|
| 241 | + $args[$key] = $this->$key; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // Add the field to the static $fields variable properly indexed |
| 245 | - Kirki::$fields[ $this->settings ] = $args; |
|
| 245 | + Kirki::$fields[$this->settings] = $args; |
|
| 246 | 246 | |
| 247 | 247 | if ( 'background' == $this->type ) { |
| 248 | 248 | // Build the background fields |
@@ -339,10 +339,10 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | $settings = array(); |
| 341 | 341 | foreach ( $this->settings as $setting_key => $setting_value ) { |
| 342 | - $settings[ sanitize_key( $setting_key ) ] = esc_attr( $setting_value ); |
|
| 342 | + $settings[sanitize_key( $setting_key )] = esc_attr( $setting_value ); |
|
| 343 | 343 | // If we're using serialized options then we need to spice this up |
| 344 | 344 | if ( 'option' == $this->option_type && '' != $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { |
| 345 | - $settings[ sanitize_key( $setting_key ) ] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ).']'; |
|
| 345 | + $settings[sanitize_key( $setting_key )] = esc_attr( $this->option_name ) . '[' . esc_attr( $setting_value ) . ']'; |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | $this->settings = $settings; |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | ); |
| 526 | 526 | |
| 527 | 527 | if ( array_key_exists( $this->type, $default_callbacks ) ) { |
| 528 | - $this->sanitize_callback = $default_callbacks[ $this->type ]; |
|
| 528 | + $this->sanitize_callback = $default_callbacks[$this->type]; |
|
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | } |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | */ |
| 895 | 895 | protected function set_required() { |
| 896 | 896 | |
| 897 | - if ( ! is_array( $this->required) ) { |
|
| 897 | + if ( ! is_array( $this->required ) ) { |
|
| 898 | 898 | $this->required = array(); |
| 899 | 899 | } |
| 900 | 900 | |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | * @access protected |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $output = array(); |
|
| 15 | + protected $output = array(); |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @access protected |
| 19 | 19 | * @var array |
| 20 | 20 | */ |
| 21 | - protected $styles = array(); |
|
| 21 | + protected $styles = array(); |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @access protected |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | return; |
| 108 | 108 | } |
| 109 | 109 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
| 110 | - $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
| 111 | - $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; |
|
| 112 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
| 110 | + $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; |
|
| 111 | + $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; |
|
| 112 | + $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
| 113 | 113 | |
| 114 | 114 | if ( is_array( $output['element'] ) ) { |
| 115 | 115 | $output['element'] = array_unique( $output['element'] ); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $output['element'] = implode( ',', $output['element'] ); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
| 120 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $output['prefix'] . $value . $output['units'] . $output['suffix']; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | 'background-position' => 'Kirki_Output_Property_Background_Position', |
| 136 | 136 | ) ); |
| 137 | 137 | if ( array_key_exists( $property, $properties ) ) { |
| 138 | - $classname = $properties[ $property ]; |
|
| 138 | + $classname = $properties[$property]; |
|
| 139 | 139 | $obj = new $classname( $property, $value ); |
| 140 | 140 | return $obj->get_value(); |
| 141 | 141 | } |
@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Plugin Name: Kirki Toolkit |
|
| 4 | - * Plugin URI: http://kirki.org |
|
| 5 | - * Description: The ultimate WordPress Customizer Toolkit |
|
| 6 | - * Author: Aristeides Stathopoulos |
|
| 7 | - * Author URI: http://aristeides.com |
|
| 8 | - * Version: 2.2.0.beta.3 |
|
| 9 | - * Text Domain: kirki |
|
| 10 | - * |
|
| 11 | - * GitHub Plugin URI: aristath/kirki |
|
| 12 | - * GitHub Plugin URI: https://github.com/aristath/kirki |
|
| 13 | - * |
|
| 14 | - * |
|
| 15 | - * @package Kirki |
|
| 16 | - * @category Core |
|
| 17 | - * @author Aristeides Stathopoulos |
|
| 18 | - * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
| 19 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
| 20 | - * @since 1.0 |
|
| 21 | - */ |
|
| 3 | + * Plugin Name: Kirki Toolkit |
|
| 4 | + * Plugin URI: http://kirki.org |
|
| 5 | + * Description: The ultimate WordPress Customizer Toolkit |
|
| 6 | + * Author: Aristeides Stathopoulos |
|
| 7 | + * Author URI: http://aristeides.com |
|
| 8 | + * Version: 2.2.0.beta.3 |
|
| 9 | + * Text Domain: kirki |
|
| 10 | + * |
|
| 11 | + * GitHub Plugin URI: aristath/kirki |
|
| 12 | + * GitHub Plugin URI: https://github.com/aristath/kirki |
|
| 13 | + * |
|
| 14 | + * |
|
| 15 | + * @package Kirki |
|
| 16 | + * @category Core |
|
| 17 | + * @author Aristeides Stathopoulos |
|
| 18 | + * @copyright Copyright (c) 2016, Aristeides Stathopoulos |
|
| 19 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
| 20 | + * @since 1.0 |
|
| 21 | + */ |
|
| 22 | 22 | |
| 23 | 23 | // Exit if accessed directly |
| 24 | 24 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -199,9 +199,9 @@ discard block |
||
| 199 | 199 | * If no callback is defined (false) then just get the value. |
| 200 | 200 | */ |
| 201 | 201 | if ( $variable_callback ) { |
| 202 | - $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 202 | + $variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 203 | 203 | } else { |
| 204 | - $variables[ $variable_name ] = Kirki::get_option( $field['settings'] ); |
|
| 204 | + $variables[$variable_name] = Kirki::get_option( $field['settings'] ); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * @param WP_Customize_Setting|onj $WP_Customize_Setting The WP_Customize_Setting instance when saving is happening. |
| 248 | 248 | */ |
| 249 | 249 | public function update_user_meta( $value, $wp_customize_setting ) { |
| 250 | - update_user_meta( get_current_user_id(), $wp_customize_setting->id, $value ); |
|
| 250 | + update_user_meta( get_current_user_id(), $wp_customize_setting->id, $value ); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | } |