@@ -40,8 +40,8 @@ |
||
| 40 | 40 | |
| 41 | 41 | $previous_path = ''; |
| 42 | 42 | for ( $i = 0; $i < $levels; $i++ ) { |
| 43 | - $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; |
|
| 44 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; |
|
| 43 | + $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; |
|
| 44 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | foreach ( $paths as $path ) { |
@@ -87,8 +87,8 @@ |
||
| 87 | 87 | 'monokai' => 'monokai', |
| 88 | 88 | 'material' => 'material', |
| 89 | 89 | ); |
| 90 | - if ( isset( $valid_themes[ $this->choices['theme'] ] ) ) { |
|
| 91 | - $this->choices['theme'] = $valid_themes[ $this->choices['theme'] ]; |
|
| 90 | + if ( isset( $valid_themes[$this->choices['theme']] ) ) { |
|
| 91 | + $this->choices['theme'] = $valid_themes[$this->choices['theme']]; |
|
| 92 | 92 | } else { |
| 93 | 93 | $this->choices['theme'] = 'elegant'; |
| 94 | 94 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | foreach ( $args as $key => $value ) { |
| 105 | 105 | // Is this property whitelisted? |
| 106 | 106 | if ( property_exists( $this, $key ) ) { |
| 107 | - $args[ $key ] = $value; |
|
| 107 | + $args[$key] = $value; |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -141,10 +141,10 @@ discard block |
||
| 141 | 141 | $id = ( '' === $id ) ? 'global' : $id; |
| 142 | 142 | |
| 143 | 143 | $id_md5 = md5( $id ); |
| 144 | - if ( ! isset( self::$instances[ $id_md5 ] ) ) { |
|
| 145 | - self::$instances[ $id_md5 ] = new self( $id, $args ); |
|
| 144 | + if ( ! isset( self::$instances[$id_md5] ) ) { |
|
| 145 | + self::$instances[$id_md5] = new self( $id, $args ); |
|
| 146 | 146 | } |
| 147 | - return self::$instances[ $id_md5 ]; |
|
| 147 | + return self::$instances[$id_md5]; |
|
| 148 | 148 | |
| 149 | 149 | } |
| 150 | 150 | |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | $fields = Kirki::$fields; |
| 27 | 27 | |
| 28 | 28 | // Make sure the current object matches a registered field. |
| 29 | - if ( ! isset( $object->setting->id ) || ! isset( $fields[ $object->setting->id ] ) ) { |
|
| 29 | + if ( ! isset( $object->setting->id ) || ! isset( $fields[$object->setting->id] ) ) { |
|
| 30 | 30 | return true; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $field = $fields[ $object->setting->id ]; |
|
| 33 | + $field = $fields[$object->setting->id]; |
|
| 34 | 34 | |
| 35 | 35 | if ( isset( $field['required'] ) ) { |
| 36 | 36 | |
@@ -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 | } |
@@ -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 | ); |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | if ( is_array( $this->choices ) ) { |
| 94 | 94 | foreach ( $this->choices as $choice => $value ) { |
| 95 | 95 | if ( 'labels' !== $choice && true === $value ) { |
| 96 | - $this->json['choices'][ $choice ] = true; |
|
| 96 | + $this->json['choices'][$choice] = true; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | if ( is_array( $this->json['default'] ) ) { |
| 101 | 101 | foreach ( $this->json['default'] as $key => $value ) { |
| 102 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
| 103 | - $this->json['value'][ $key ] = $value; |
|
| 102 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
| 103 | + $this->json['value'][$key] = $value; |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -208,6 +208,6 @@ discard block |
||
| 208 | 208 | if ( false === $id ) { |
| 209 | 209 | return $translation_strings; |
| 210 | 210 | } |
| 211 | - return $translation_strings[ $id ]; |
|
| 211 | + return $translation_strings[$id]; |
|
| 212 | 212 | } |
| 213 | 213 | } |