@@ -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 | |
@@ -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 | |
@@ -172,9 +172,9 @@ |
||
| 172 | 172 | * If no callback is defined (false) then just get the value. |
| 173 | 173 | */ |
| 174 | 174 | if ( $variable_callback ) { |
| 175 | - $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 175 | + $variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 176 | 176 | } else { |
| 177 | - $variables[ $variable_name ] = Kirki::get_option( $field['settings'] ); |
|
| 177 | + $variables[$variable_name] = Kirki::get_option( $field['settings'] ); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | } |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | |
| 22 | 22 | $previous_path = ''; |
| 23 | 23 | for ( $i = 0; $i < $levels; $i++ ) { |
| 24 | - $paths[] = $path . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; |
|
| 25 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; |
|
| 24 | + $paths[] = $path . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; |
|
| 25 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | foreach ( $paths as $path ) { |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | foreach ( $args['fields'] as $key => $value ) { |
| 36 | 36 | if ( ! isset( $value['default'] ) ) { |
| 37 | - $args['fields'][ $key ]['default'] = ''; |
|
| 37 | + $args['fields'][$key]['default'] = ''; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | if ( ! isset( $value['label'] ) ) { |
| 41 | - $args['fields'][ $key ]['label'] = ''; |
|
| 41 | + $args['fields'][$key]['label'] = ''; |
|
| 42 | 42 | } |
| 43 | - $args['fields'][ $key ]['id'] = $key; |
|
| 43 | + $args['fields'][$key]['id'] = $key; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->fields = $args['fields']; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | continue; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $fields[ $key ]['buttonLabels'] = $default_image_button_labels; |
|
| 66 | + $fields[$key]['buttonLabels'] = $default_image_button_labels; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $this->json['fields'] = $fields; |
@@ -26,15 +26,15 @@ |
||
| 26 | 26 | if ( is_array( $this->choices ) ) { |
| 27 | 27 | foreach ( $this->choices as $choice => $value ) { |
| 28 | 28 | if ( true === $value ) { |
| 29 | - $this->json['choices'][ $choice ] = true; |
|
| 29 | + $this->json['choices'][$choice] = true; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if ( is_array( $this->json['default'] ) ) { |
| 35 | 35 | foreach ( $this->json['default'] as $key => $value ) { |
| 36 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
| 37 | - $this->json['value'][ $key ] = $value; |
|
| 36 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
| 37 | + $this->json['value'][$key] = $value; |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | return 'auto'; |
| 190 | 190 | } |
| 191 | 191 | // Return empty if there are no numbers in the value. |
| 192 | - if ( ! preg_match( '#[0-9]#' , $value ) ) { |
|
| 192 | + if ( ! preg_match( '#[0-9]#', $value ) ) { |
|
| 193 | 193 | return ''; |
| 194 | 194 | } |
| 195 | 195 | // The raw value without the units |
@@ -9,13 +9,13 @@ |
||
| 9 | 9 | // Add backup font |
| 10 | 10 | if ( Kirki_Fonts::is_google_font( $this->value ) ) { |
| 11 | 11 | |
| 12 | - if ( isset( $google_fonts_array[ $this->value ] ) && isset( $google_fonts_array[ $this->value ]['category'] ) ) { |
|
| 13 | - if ( isset( $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ] ) ) { |
|
| 12 | + if ( isset( $google_fonts_array[$this->value] ) && isset( $google_fonts_array[$this->value]['category'] ) ) { |
|
| 13 | + if ( isset( $backup_fonts[$google_fonts_array[$this->value]['category']] ) ) { |
|
| 14 | 14 | // add double quotes if needed |
| 15 | 15 | if ( false !== strpos( $this->value, ' ' ) && false === strpos( $this->value, '"' ) ) { |
| 16 | - $this->value = '"' . $this->value . '", ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
| 16 | + $this->value = '"' . $this->value . '", ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
| 17 | 17 | } else { |
| 18 | - $this->value .= ', ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
| 18 | + $this->value .= ', ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | 'typography' => 'Kirki_Output_Control_Typography', |
| 97 | 97 | ) ); |
| 98 | 98 | if ( array_key_exists( self::$field_type, $field_output_classes ) ) { |
| 99 | - $classname = $field_output_classes[ self::$field_type ]; |
|
| 99 | + $classname = $field_output_classes[self::$field_type]; |
|
| 100 | 100 | } |
| 101 | 101 | $obj = new $classname( $field['kirki_config'], self::$output, self::$value ); |
| 102 | 102 | return $obj->get_styles(); |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | 'transition', |
| 173 | 173 | 'transition-property', |
| 174 | 174 | ) ) ) { |
| 175 | - $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; |
|
| 176 | - $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; |
|
| 175 | + $css[$media_query][$element]['-webkit-' . $property] = $value; |
|
| 176 | + $css[$media_query][$element]['-moz-' . $property] = $value; |
|
| 177 | 177 | } |
| 178 | 178 | /** |
| 179 | 179 | * Add -ms-* and -o-* |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | 'transition', |
| 185 | 185 | 'transition-property', |
| 186 | 186 | ) ) ) { |
| 187 | - $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; |
|
| 188 | - $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; |
|
| 187 | + $css[$media_query][$element]['-ms-' . $property] = $value; |
|
| 188 | + $css[$media_query][$element]['-o-' . $property] = $value; |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | } |