@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $config = Kirki_Config::get_instance( $config_id, $args ); |
| 146 | 146 | $config_args = $config->get_config(); |
| 147 | - self::$config[ $config_args['id'] ] = $config_args; |
|
| 147 | + self::$config[ $config_args[ 'id' ] ] = $config_args; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public static function add_panel( $id = '', $args = array() ) { |
| 159 | 159 | |
| 160 | - $args['id'] = esc_attr( $id ); |
|
| 161 | - $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : ''; |
|
| 162 | - $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10; |
|
| 163 | - $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default'; |
|
| 164 | - $args['type'] = 'kirki-' . $args['type']; |
|
| 160 | + $args[ 'id' ] = esc_attr( $id ); |
|
| 161 | + $args[ 'description' ] = ( isset( $args[ 'description' ] ) ) ? $args[ 'description' ] : ''; |
|
| 162 | + $args[ 'priority' ] = ( isset( $args[ 'priority' ] ) ) ? absint( $args[ 'priority' ] ) : 10; |
|
| 163 | + $args[ 'type' ] = ( isset( $args[ 'type' ] ) ) ? $args[ 'type' ] : 'default'; |
|
| 164 | + $args[ 'type' ] = 'kirki-' . $args[ 'type' ]; |
|
| 165 | 165 | |
| 166 | - self::$panels[ $args['id'] ] = $args; |
|
| 166 | + self::$panels[ $args[ 'id' ] ] = $args; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public static function remove_panel( $id = '' ) { |
| 178 | 178 | if ( ! in_array( $id, self::$panels_to_remove, true ) ) { |
| 179 | - self::$panels_to_remove[] = $id; |
|
| 179 | + self::$panels_to_remove[ ] = $id; |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
@@ -190,14 +190,14 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public static function add_section( $id, $args ) { |
| 192 | 192 | |
| 193 | - $args['id'] = esc_attr( $id ); |
|
| 194 | - $args['panel'] = ( isset( $args['panel'] ) ) ? esc_attr( $args['panel'] ) : ''; |
|
| 195 | - $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : ''; |
|
| 196 | - $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10; |
|
| 197 | - $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default'; |
|
| 198 | - $args['type'] = 'kirki-' . $args['type']; |
|
| 193 | + $args[ 'id' ] = esc_attr( $id ); |
|
| 194 | + $args[ 'panel' ] = ( isset( $args[ 'panel' ] ) ) ? esc_attr( $args[ 'panel' ] ) : ''; |
|
| 195 | + $args[ 'description' ] = ( isset( $args[ 'description' ] ) ) ? $args[ 'description' ] : ''; |
|
| 196 | + $args[ 'priority' ] = ( isset( $args[ 'priority' ] ) ) ? absint( $args[ 'priority' ] ) : 10; |
|
| 197 | + $args[ 'type' ] = ( isset( $args[ 'type' ] ) ) ? $args[ 'type' ] : 'default'; |
|
| 198 | + $args[ 'type' ] = 'kirki-' . $args[ 'type' ]; |
|
| 199 | 199 | |
| 200 | - self::$sections[ $args['id'] ] = $args; |
|
| 200 | + self::$sections[ $args[ 'id' ] ] = $args; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public static function remove_section( $id = '' ) { |
| 212 | 212 | if ( ! in_array( $id, self::$sections_to_remove, true ) ) { |
| 213 | - self::$sections_to_remove[] = $id; |
|
| 213 | + self::$sections_to_remove[ ] = $id; |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
@@ -229,16 +229,16 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | // Early exit if 'type' is not defined. |
| 232 | - if ( ! isset( $args['type'] ) ) { |
|
| 232 | + if ( ! isset( $args[ 'type' ] ) ) { |
|
| 233 | 233 | return; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // If the field is font-awesome, enqueue the icons on the frontend. |
| 237 | - if ( class_exists( 'Kirki_Modules_CSS' ) && ( 'fontawesome' === $args['type'] || 'kirki-fontawesome' === $args['type'] ) ) { |
|
| 237 | + if ( class_exists( 'Kirki_Modules_CSS' ) && ( 'fontawesome' === $args[ 'type' ] || 'kirki-fontawesome' === $args[ 'type' ] ) ) { |
|
| 238 | 238 | Kirki_Modules_CSS::add_fontawesome_script(); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - $str = str_replace( array( '-', '_' ), ' ', $args['type'] ); |
|
| 241 | + $str = str_replace( array( '-', '_' ), ' ', $args[ 'type' ] ); |
|
| 242 | 242 | $classname = 'Kirki_Field_' . str_replace( ' ', '_', ucwords( $str ) ); |
| 243 | 243 | if ( class_exists( $classname ) ) { |
| 244 | 244 | new $classname( $config_id, $args ); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | public static function remove_control( $id ) { |
| 268 | 268 | if ( ! in_array( $id, self::$controls_to_remove, true ) ) { |
| 269 | - self::$controls_to_remove[] = $id; |
|
| 269 | + self::$controls_to_remove[ ] = $id; |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |