@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @return mixed |
34 | 34 | */ |
35 | 35 | protected function get_root_value( $default = null ) { |
36 | - return get_site_option( $this->id_data['base'], $default ); |
|
36 | + return get_site_option( $this->id_data[ 'base' ], $default ); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return bool Whether the multidimensional root was updated successfully. |
46 | 46 | */ |
47 | 47 | protected function set_root_value( $value ) { |
48 | - return update_site_option( $this->id_data['base'], $value ); |
|
48 | + return update_site_option( $this->id_data[ 'base' ], $value ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -119,7 +119,7 @@ |
||
119 | 119 | global $l10n; |
120 | 120 | if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) { |
121 | 121 | // @codingStandardsIgnoreLine WordPress.Variables.GlobalVariables.OverrideProhibited |
122 | - $l10n['kirki'] = $l10n[ $this->get_theme_textdomain() ]; |
|
122 | + $l10n[ 'kirki' ] = $l10n[ $this->get_theme_textdomain() ]; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | // Check if the domain is "kirki". |
@@ -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 |
@@ -388,7 +388,8 @@ |
||
388 | 388 | } elseif ( '!==' === $operator && $value1 !== $value2 ) { |
389 | 389 | $return = true; |
390 | 390 | // @codingStandardsIgnoreLine WordPress.PHP.StrictComparisons.LooseComparison |
391 | - } elseif ( ( '!=' === $operator || 'not equal' === $operator ) && $value1 != $value2 ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison |
|
391 | + } elseif ( ( '!=' === $operator || 'not equal' === $operator ) && $value1 != $value2 ) { |
|
392 | +// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison |
|
392 | 393 | $return = true; |
393 | 394 | } elseif ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) && $value2 >= $value1 ) { |
394 | 395 | $return = true; |
@@ -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 |
@@ -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 | } |
@@ -49,10 +49,10 @@ |
||
49 | 49 | 'panel', |
50 | 50 | ) ); |
51 | 51 | |
52 | - $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
53 | - $array['content'] = $this->get_content(); |
|
54 | - $array['active'] = $this->active(); |
|
55 | - $array['instanceNumber'] = $this->instance_number; |
|
52 | + $array[ 'title' ] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
53 | + $array[ 'content' ] = $this->get_content(); |
|
54 | + $array[ 'active' ] = $this->active(); |
|
55 | + $array[ 'instanceNumber' ] = $this->instance_number; |
|
56 | 56 | |
57 | 57 | return $array; |
58 | 58 | } |
@@ -51,15 +51,15 @@ |
||
51 | 51 | 'section', |
52 | 52 | ) ); |
53 | 53 | |
54 | - $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
55 | - $array['content'] = $this->get_content(); |
|
56 | - $array['active'] = $this->active(); |
|
57 | - $array['instanceNumber'] = $this->instance_number; |
|
54 | + $array[ 'title' ] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
55 | + $array[ 'content' ] = $this->get_content(); |
|
56 | + $array[ 'active' ] = $this->active(); |
|
57 | + $array[ 'instanceNumber' ] = $this->instance_number; |
|
58 | 58 | |
59 | - $array['customizeAction'] = esc_attr__( 'Customizing', 'kirki' ); |
|
59 | + $array[ 'customizeAction' ] = esc_attr__( 'Customizing', 'kirki' ); |
|
60 | 60 | if ( $this->panel ) { |
61 | 61 | /* translators: The title. */ |
62 | - $array['customizeAction'] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); |
|
62 | + $array[ 'customizeAction' ] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); |
|
63 | 63 | } |
64 | 64 | return $array; |
65 | 65 | } |