@@ -203,9 +203,9 @@ |
||
| 203 | 203 | // and run it through the callback function. |
| 204 | 204 | // If no callback is defined (false) then just get the value. |
| 205 | 205 | if ( $variable_callback ) { |
| 206 | - $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 206 | + $variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
| 207 | 207 | } else { |
| 208 | - $variables[ $variable_name ] = Kirki::get_option( $field['settings'] ); |
|
| 208 | + $variables[$variable_name] = Kirki::get_option( $field['settings'] ); |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | } |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | $count = count( $args ); |
| 44 | 44 | for ( $i = 1; $i < $count; $i++ ) { |
| 45 | - if ( is_array( $args[ $i ] ) ) { |
|
| 46 | - $array = self::recurse( $array, $args[ $i ] ); |
|
| 45 | + if ( is_array( $args[$i] ) ) { |
|
| 46 | + $array = self::recurse( $array, $args[$i] ); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | return $array; |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | public static function recurse( $array, $array1 ) { |
| 62 | 62 | foreach ( $array1 as $key => $value ) { |
| 63 | 63 | // Create new key in $array, if it is empty or not an array. |
| 64 | - if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { |
|
| 65 | - $array[ $key ] = array(); |
|
| 64 | + if ( ! isset( $array[$key] ) || ( isset( $array[$key] ) && ! is_array( $array[$key] ) ) ) { |
|
| 65 | + $array[$key] = array(); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Overwrite the value in the base array. |
| 69 | 69 | if ( is_array( $value ) ) { |
| 70 | - $value = self::recurse( $array[ $key ], $value ); |
|
| 70 | + $value = self::recurse( $array[$key], $value ); |
|
| 71 | 71 | } |
| 72 | - $array[ $key ] = $value; |
|
| 72 | + $array[$key] = $value; |
|
| 73 | 73 | } |
| 74 | 74 | return $array; |
| 75 | 75 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | // Properly format the array. |
| 135 | 135 | $items = array(); |
| 136 | 136 | foreach ( $posts as $post ) { |
| 137 | - $items[ $post->ID ] = $post->post_title; |
|
| 137 | + $items[$post->ID] = $post->post_title; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | return $items; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | foreach ( $taxonomies as $taxonomy ) { |
| 160 | 160 | $id = $taxonomy; |
| 161 | 161 | $taxonomy = get_taxonomy( $taxonomy ); |
| 162 | - $items[ $id ] = $taxonomy->labels->name; |
|
| 162 | + $items[$id] = $taxonomy->labels->name; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return $items; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | // Build the array. |
| 184 | 184 | foreach ( $post_types as $post_type ) { |
| 185 | - $items[ $post_type->name ] = $post_type->labels->name; |
|
| 185 | + $items[$post_type->name] = $post_type->labels->name; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $items; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | // Build the array. |
| 208 | 208 | foreach ( $terms as $term ) { |
| 209 | - $items[ $term->term_id ] = $term->name; |
|
| 209 | + $items[$term->term_id] = $term->name; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | return $items; |
@@ -577,8 +577,8 @@ discard block |
||
| 577 | 577 | unset( $colors['primary'] ); |
| 578 | 578 | $position_colors = array(); |
| 579 | 579 | foreach ( $colors as $color_family ) { |
| 580 | - if ( isset( $color_family[ $key ] ) ) { |
|
| 581 | - $position_colors[] = $color_family[ $key ]; |
|
| 580 | + if ( isset( $color_family[$key] ) ) { |
|
| 581 | + $position_colors[] = $color_family[$key]; |
|
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | return $position_colors; |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | case 'primary': |
| 595 | 595 | return $colors['primary']; |
| 596 | 596 | default: |
| 597 | - if ( isset( $colors[ $context ] ) ) { |
|
| 598 | - return $colors[ $context ]; |
|
| 597 | + if ( isset( $colors[$context] ) ) { |
|
| 598 | + return $colors[$context]; |
|
| 599 | 599 | } |
| 600 | 600 | return $colors['primary']; |
| 601 | 601 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // Sanitize each sub-value separately. |
| 54 | 54 | foreach ( $value as $key => $sub_value ) { |
| 55 | - $value[ $key ] = Kirki_Sanitize_Values::css_dimension( $sub_value ); |
|
| 55 | + $value[$key] = Kirki_Sanitize_Values::css_dimension( $sub_value ); |
|
| 56 | 56 | } |
| 57 | 57 | return $value; |
| 58 | 58 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $this->choices['controls'] = array(); |
| 70 | 70 | if ( is_array( $this->default ) ) { |
| 71 | 71 | foreach ( $this->default as $key => $value ) { |
| 72 | - $this->choices['controls'][ $key ] = true; |
|
| 72 | + $this->choices['controls'][$key] = true; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | // Simple sanitization. |
| 37 | 37 | if ( ! empty( $this->button_labels ) ) { |
| 38 | 38 | foreach ( $this->button_labels as $key => $value ) { |
| 39 | - $this->button_labels[ sanitize_key( $key ) ] = esc_attr( $value ); |
|
| 39 | + $this->button_labels[sanitize_key( $key )] = esc_attr( $value ); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | foreach ( self::$modules as $key => $module_class ) { |
| 83 | 83 | if ( class_exists( $module_class ) ) { |
| 84 | - self::$active_modules[ $key ] = new $module_class(); |
|
| 84 | + self::$active_modules[$key] = new $module_class(); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $key = array_search( $module, self::$modules, true ); |
| 117 | 117 | if ( false !== $key ) { |
| 118 | - unset( self::$modules[ $key ] ); |
|
| 118 | + unset( self::$modules[$key] ); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $fields = Kirki::$fields; |
| 43 | 43 | foreach ( $fields as $field ) { |
| 44 | 44 | if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['js_vars'] ) && ! empty( $field['js_vars'] ) && is_array( $field['js_vars'] ) && isset( $field['settings'] ) ) { |
| 45 | - $js_vars_fields[ $field['settings'] ] = $field['js_vars']; |
|
| 45 | + $js_vars_fields[$field['settings']] = $field['js_vars']; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | wp_localize_script( 'kirki_auto_postmessage', 'jsvars', $js_vars_fields ); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function add_icon( $id, $icon, $context = 'section' ) { |
| 51 | 51 | |
| 52 | - self::$icons[ $context ][ $id ] = trim( $icon ); |
|
| 52 | + self::$icons[$context][$id] = trim( $icon ); |
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | foreach ( $fields as $field ) { |
| 55 | 55 | if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) { |
| 56 | 56 | $id = str_replace( '[', '-', str_replace( ']', '', $field['settings'] ) ); |
| 57 | - $this->tooltips_content[ $id ] = array( |
|
| 57 | + $this->tooltips_content[$id] = array( |
|
| 58 | 58 | 'id' => $id, |
| 59 | 59 | 'content' => wp_kses_post( $field['tooltip'] ), |
| 60 | 60 | ); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function add_tooltip( $field_id, $tooltip ) { |
| 74 | 74 | |
| 75 | - $this->tooltips_content[ $field_id ] = array( |
|
| 75 | + $this->tooltips_content[$field_id] = array( |
|
| 76 | 76 | 'id' => sanitize_key( $field_id ), |
| 77 | 77 | 'content' => wp_kses_post( $tooltip ), |
| 78 | 78 | ); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $google_fonts = array(); |
| 101 | 101 | if ( is_array( $fonts ) ) { |
| 102 | 102 | foreach ( $fonts['items'] as $font ) { |
| 103 | - $google_fonts[ $font['family'] ] = array( |
|
| 103 | + $google_fonts[$font['family']] = array( |
|
| 104 | 104 | 'label' => $font['family'], |
| 105 | 105 | 'variants' => $font['variants'], |
| 106 | 106 | 'subsets' => $font['subsets'], |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $fonts = self::get_all_fonts(); |
| 176 | 176 | $fonts_array = array(); |
| 177 | 177 | foreach ( $fonts as $key => $args ) { |
| 178 | - $fonts_array[ $key ] = $key; |
|
| 178 | + $fonts_array[$key] = $key; |
|
| 179 | 179 | } |
| 180 | 180 | return $fonts_array; |
| 181 | 181 | } |