@@ -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 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) { |
| 70 | 70 | $args['type'] = 'default'; |
| 71 | 71 | } |
| 72 | - $classname = $this->setting_types[ $args['type'] ]; |
|
| 72 | + $classname = $this->setting_types[$args['type']]; |
|
| 73 | 73 | |
| 74 | 74 | // If settings are defined as an array, then we need to go through them |
| 75 | 75 | // and call add_setting for each one of them separately. |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $args['default'] = array(); |
| 81 | 81 | } |
| 82 | 82 | foreach ( $args['settings'] as $key => $value ) { |
| 83 | - $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : ''; |
|
| 83 | + $default = ( isset( $defaults[$key] ) ) ? $defaults[$key] : ''; |
|
| 84 | 84 | $this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | foreach ( $this->setting_types as $key => $classname ) { |
| 132 | 132 | |
| 133 | 133 | if ( ! class_exists( $classname ) ) { |
| 134 | - unset( $this->setting_types[ $key ] ); |
|
| 134 | + unset( $this->setting_types[$key] ); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -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 | } |
@@ -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 ); |