@@ -92,8 +92,8 @@ |
||
| 92 | 92 | // Get defaults from the class. |
| 93 | 93 | $defaults = get_class_vars( __CLASS__ ); |
| 94 | 94 | // Skip what we don't need in this context. |
| 95 | - unset( $defaults['config_final'] ); |
|
| 96 | - unset( $defaults['instances'] ); |
|
| 95 | + unset( $defaults[ 'config_final' ] ); |
|
| 96 | + unset( $defaults[ 'instances' ] ); |
|
| 97 | 97 | // Apply any kirki/config global filters. |
| 98 | 98 | $defaults = apply_filters( 'kirki/config', $defaults ); |
| 99 | 99 | // Merge our args with the defaults. |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // Handle the arguments, merge one by one. |
| 38 | 38 | $args = func_get_args(); |
| 39 | - $array = $args[0]; |
|
| 39 | + $array = $args[ 0 ]; |
|
| 40 | 40 | if ( ! is_array( $array ) ) { |
| 41 | 41 | return $array; |
| 42 | 42 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ( ! empty( $attachment ) ) { |
| 115 | - return $attachment[0]; |
|
| 115 | + return $attachment[ 0 ]; |
|
| 116 | 116 | } |
| 117 | 117 | return 0; |
| 118 | 118 | } |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | $image = wp_get_attachment_image_src( $image_id, 'full' ); |
| 130 | 130 | |
| 131 | 131 | return array( |
| 132 | - 'url' => $image[0], |
|
| 133 | - 'width' => $image[1], |
|
| 134 | - 'height' => $image[2], |
|
| 135 | - 'thumbnail' => $image[3], |
|
| 132 | + 'url' => $image[ 0 ], |
|
| 133 | + 'width' => $image[ 1 ], |
|
| 134 | + 'height' => $image[ 2 ], |
|
| 135 | + 'thumbnail' => $image[ 3 ], |
|
| 136 | 136 | ); |
| 137 | 137 | |
| 138 | 138 | } |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | 'suppress_filters' => false, |
| 154 | 154 | ) |
| 155 | 155 | ); |
| 156 | - } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) { |
|
| 157 | - $args['suppress_filters'] = false; |
|
| 156 | + } elseif ( is_array( $args ) && ! isset( $args[ 'suppress_filters' ] ) ) { |
|
| 157 | + $args[ 'suppress_filters' ] = false; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // Get the posts. |
@@ -303,41 +303,41 @@ discard block |
||
| 303 | 303 | $key = absint( $context ) / 100; |
| 304 | 304 | if ( 'A100' === $context ) { |
| 305 | 305 | $key = 10; |
| 306 | - unset( $colors['grey'] ); |
|
| 306 | + unset( $colors[ 'grey' ] ); |
|
| 307 | 307 | } elseif ( 'A200' === $context ) { |
| 308 | 308 | $key = 11; |
| 309 | - unset( $colors['grey'] ); |
|
| 309 | + unset( $colors[ 'grey' ] ); |
|
| 310 | 310 | } elseif ( 'A400' === $context ) { |
| 311 | 311 | $key = 12; |
| 312 | - unset( $colors['grey'] ); |
|
| 312 | + unset( $colors[ 'grey' ] ); |
|
| 313 | 313 | } elseif ( 'A700' === $context ) { |
| 314 | 314 | $key = 13; |
| 315 | - unset( $colors['grey'] ); |
|
| 315 | + unset( $colors[ 'grey' ] ); |
|
| 316 | 316 | } |
| 317 | - unset( $colors['primary'] ); |
|
| 317 | + unset( $colors[ 'primary' ] ); |
|
| 318 | 318 | $position_colors = array(); |
| 319 | 319 | foreach ( $colors as $color_family ) { |
| 320 | 320 | if ( isset( $color_family[ $key ] ) ) { |
| 321 | - $position_colors[] = $color_family[ $key ]; |
|
| 321 | + $position_colors[ ] = $color_family[ $key ]; |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | return $position_colors; |
| 325 | 325 | case 'all': |
| 326 | - unset( $colors['primary'] ); |
|
| 326 | + unset( $colors[ 'primary' ] ); |
|
| 327 | 327 | $all_colors = array(); |
| 328 | 328 | foreach ( $colors as $color_family ) { |
| 329 | 329 | foreach ( $color_family as $color ) { |
| 330 | - $all_colors[] = $color; |
|
| 330 | + $all_colors[ ] = $color; |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | return $all_colors; |
| 334 | 334 | case 'primary': |
| 335 | - return $colors['primary']; |
|
| 335 | + return $colors[ 'primary' ]; |
|
| 336 | 336 | default: |
| 337 | 337 | if ( isset( $colors[ $context ] ) ) { |
| 338 | 338 | return $colors[ $context ]; |
| 339 | 339 | } |
| 340 | - return $colors['primary']; |
|
| 340 | + return $colors[ 'primary' ]; |
|
| 341 | 341 | } // End switch(). |
| 342 | 342 | } |
| 343 | 343 | |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | public static function add_module( $module ) { |
| 105 | 105 | |
| 106 | 106 | if ( ! in_array( $module, self::$modules, true ) ) { |
| 107 | - self::$modules[] = $module; |
|
| 107 | + self::$modules[ ] = $module; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | } |
@@ -46,12 +46,12 @@ |
||
| 46 | 46 | public function add_panel( $args ) { |
| 47 | 47 | global $wp_customize; |
| 48 | 48 | |
| 49 | - if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) { |
|
| 50 | - $args['type'] = 'default'; |
|
| 49 | + if ( ! isset( $args[ 'type' ] ) || ! array_key_exists( $args[ 'type' ], $this->panel_types ) ) { |
|
| 50 | + $args[ 'type' ] = 'default'; |
|
| 51 | 51 | } |
| 52 | - $panel_classname = $this->panel_types[ $args['type'] ]; |
|
| 52 | + $panel_classname = $this->panel_types[ $args[ 'type' ] ]; |
|
| 53 | 53 | |
| 54 | - $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); |
|
| 54 | + $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args[ 'id' ] ), $args ) ); |
|
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | // Echo the styles. |
| 21 | 21 | $configs = Kirki::$config; |
| 22 | 22 | foreach ( $configs as $config_id => $args ) { |
| 23 | - if ( true === $args['disable_output'] ) { |
|
| 23 | + if ( true === $args[ 'disable_output' ] ) { |
|
| 24 | 24 | continue; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -49,16 +49,16 @@ |
||
| 49 | 49 | // The default class to be used when creating a section. |
| 50 | 50 | $section_classname = 'WP_Customize_Section'; |
| 51 | 51 | |
| 52 | - if ( isset( $args['type'] ) && array_key_exists( $args['type'], $this->section_types ) ) { |
|
| 53 | - $section_classname = $this->section_types[ $args['type'] ]; |
|
| 52 | + if ( isset( $args[ 'type' ] ) && array_key_exists( $args[ 'type' ], $this->section_types ) ) { |
|
| 53 | + $section_classname = $this->section_types[ $args[ 'type' ] ]; |
|
| 54 | 54 | } |
| 55 | - if ( isset( $args['type'] ) && 'kirki-outer' === $args['type'] ) { |
|
| 56 | - $args['type'] = 'outer'; |
|
| 55 | + if ( isset( $args[ 'type' ] ) && 'kirki-outer' === $args[ 'type' ] ) { |
|
| 56 | + $args[ 'type' ] = 'outer'; |
|
| 57 | 57 | $section_classname = 'WP_Customize_Section'; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Add the section. |
| 61 | - $wp_customize->add_section( new $section_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); |
|
| 61 | + $wp_customize->add_section( new $section_classname( $wp_customize, sanitize_key( $args[ 'id' ] ), $args ) ); |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | $css = ''; |
| 37 | 37 | if ( ! empty( Kirki::$sections ) ) { |
| 38 | 38 | foreach ( Kirki::$sections as $section_args ) { |
| 39 | - if ( isset( $section_args['id'] ) && isset( $section_args['type'] ) && 'outer' === $section_args['type'] || 'kirki-outer' === $section_args['type'] ) { |
|
| 40 | - $css .= '#customize-theme-controls li#accordion-section-' . $section_args['id'] . '{display:list-item!important;}'; |
|
| 39 | + if ( isset( $section_args[ 'id' ] ) && isset( $section_args[ 'type' ] ) && 'outer' === $section_args[ 'type' ] || 'kirki-outer' === $section_args[ 'type' ] ) { |
|
| 40 | + $css .= '#customize-theme-controls li#accordion-section-' . $section_args[ 'id' ] . '{display:list-item!important;}'; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -67,28 +67,28 @@ |
||
| 67 | 67 | |
| 68 | 68 | // Get the classname we'll be using to create our setting(s). |
| 69 | 69 | $classname = false; |
| 70 | - if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) { |
|
| 71 | - $classname = $this->setting_types[ $args['option_type'] ]; |
|
| 70 | + if ( isset( $args[ 'option_type' ] ) && array_key_exists( $args[ 'option_type' ], $this->setting_types ) ) { |
|
| 71 | + $classname = $this->setting_types[ $args[ 'option_type' ] ]; |
|
| 72 | 72 | } |
| 73 | - if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) { |
|
| 74 | - $args['type'] = 'default'; |
|
| 73 | + if ( ! isset( $args[ 'type' ] ) || ! array_key_exists( $args[ 'type' ], $this->setting_types ) ) { |
|
| 74 | + $args[ 'type' ] = 'default'; |
|
| 75 | 75 | } |
| 76 | - $classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname; |
|
| 76 | + $classname = ! $classname ? $this->setting_types[ $args[ 'type' ] ] : $classname; |
|
| 77 | 77 | |
| 78 | 78 | // If settings are defined as an array, then we need to go through them |
| 79 | 79 | // and call add_setting for each one of them separately. |
| 80 | - if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) { |
|
| 80 | + if ( isset( $args[ 'settings' ] ) && is_array( $args[ 'settings' ] ) ) { |
|
| 81 | 81 | |
| 82 | 82 | // Make sure defaults have been defined. |
| 83 | - if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) { |
|
| 84 | - $args['default'] = array(); |
|
| 83 | + if ( ! isset( $args[ 'default' ] ) || ! is_array( $args[ 'default' ] ) ) { |
|
| 84 | + $args[ 'default' ] = array(); |
|
| 85 | 85 | } |
| 86 | - foreach ( $args['settings'] as $key => $value ) { |
|
| 87 | - $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : ''; |
|
| 88 | - $this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); |
|
| 86 | + foreach ( $args[ 'settings' ] as $key => $value ) { |
|
| 87 | + $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : ''; |
|
| 88 | + $this->add_setting( $classname, $value, $default, $args[ 'option_type' ], $args[ 'capability' ], $args[ 'transport' ], $args[ 'sanitize_callback' ] ); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | - $this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); |
|
| 91 | + $this->add_setting( $classname, $args[ 'settings' ], $args[ 'default' ], $args[ 'option_type' ], $args[ 'capability' ], $args[ 'transport' ], $args[ 'sanitize_callback' ] ); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | // Apply the kirki/config filter. |
| 60 | 60 | $config = apply_filters( 'kirki/config', array() ); |
| 61 | - if ( isset( $config['url_path'] ) ) { |
|
| 62 | - Kirki::$url = $config['url_path']; |
|
| 61 | + if ( isset( $config[ 'url_path' ] ) ) { |
|
| 62 | + Kirki::$url = $config[ 'url_path' ]; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Make sure the right protocol is used. |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | if ( ! empty( Kirki::$panels ) ) { |
| 168 | 168 | foreach ( Kirki::$panels as $panel_args ) { |
| 169 | 169 | // Extra checks for nested panels. |
| 170 | - if ( isset( $panel_args['panel'] ) ) { |
|
| 171 | - if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { |
|
| 170 | + if ( isset( $panel_args[ 'panel' ] ) ) { |
|
| 171 | + if ( isset( Kirki::$panels[ $panel_args[ 'panel' ] ] ) ) { |
|
| 172 | 172 | // Set the type to nested. |
| 173 | - $panel_args['type'] = 'kirki-nested'; |
|
| 173 | + $panel_args[ 'type' ] = 'kirki-nested'; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -188,14 +188,14 @@ discard block |
||
| 188 | 188 | if ( ! empty( Kirki::$sections ) ) { |
| 189 | 189 | foreach ( Kirki::$sections as $section_args ) { |
| 190 | 190 | // Extra checks for nested sections. |
| 191 | - if ( isset( $section_args['section'] ) ) { |
|
| 192 | - if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { |
|
| 191 | + if ( isset( $section_args[ 'section' ] ) ) { |
|
| 192 | + if ( isset( Kirki::$sections[ $section_args[ 'section' ] ] ) ) { |
|
| 193 | 193 | // Set the type to nested. |
| 194 | - $section_args['type'] = 'kirki-nested'; |
|
| 194 | + $section_args[ 'type' ] = 'kirki-nested'; |
|
| 195 | 195 | // We need to check if the parent section is nested inside a panel. |
| 196 | - $parent_section = Kirki::$sections[ $section_args['section'] ]; |
|
| 197 | - if ( isset( $parent_section['panel'] ) ) { |
|
| 198 | - $section_args['panel'] = $parent_section['panel']; |
|
| 196 | + $parent_section = Kirki::$sections[ $section_args[ 'section' ] ]; |
|
| 197 | + if ( isset( $parent_section[ 'panel' ] ) ) { |
|
| 198 | + $section_args[ 'panel' ] = $parent_section[ 'panel' ]; |
|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | } |