@@ -69,13 +69,13 @@ |
||
69 | 69 | |
70 | 70 | // Start parsing the fields. |
71 | 71 | foreach ( $fields as $field ) { |
72 | - if ( isset( $field['partial_refresh'] ) && ! empty( $field['partial_refresh'] ) ) { |
|
72 | + if ( isset( $field[ 'partial_refresh' ] ) && ! empty( $field[ 'partial_refresh' ] ) ) { |
|
73 | 73 | // Start going through each item in the array of partial refreshes. |
74 | - foreach ( $field['partial_refresh'] as $partial_refresh => $partial_refresh_args ) { |
|
74 | + foreach ( $field[ 'partial_refresh' ] as $partial_refresh => $partial_refresh_args ) { |
|
75 | 75 | // If we have all we need, create the selective refresh call. |
76 | - if ( isset( $partial_refresh_args['render_callback'] ) && isset( $partial_refresh_args['selector'] ) ) { |
|
76 | + if ( isset( $partial_refresh_args[ 'render_callback' ] ) && isset( $partial_refresh_args[ 'selector' ] ) ) { |
|
77 | 77 | $partial_refresh_args = wp_parse_args( $partial_refresh_args, array( |
78 | - 'settings' => $field['settings'], |
|
78 | + 'settings' => $field[ 'settings' ], |
|
79 | 79 | ) ); |
80 | 80 | $wp_customize->selective_refresh->add_partial( $partial_refresh, $partial_refresh_args ); |
81 | 81 | } |
@@ -73,14 +73,14 @@ |
||
73 | 73 | 'logoImage' => '', |
74 | 74 | 'description' => '', |
75 | 75 | ); |
76 | - if ( isset( $config['logo_image'] ) && '' !== $config['logo_image'] ) { |
|
77 | - $vars['logoImage'] = esc_url_raw( $config['logo_image'] ); |
|
76 | + if ( isset( $config[ 'logo_image' ] ) && '' !== $config[ 'logo_image' ] ) { |
|
77 | + $vars[ 'logoImage' ] = esc_url_raw( $config[ 'logo_image' ] ); |
|
78 | 78 | } |
79 | - if ( isset( $config['description'] ) && '' !== $config['description'] ) { |
|
80 | - $vars['description'] = esc_textarea( $config['description'] ); |
|
79 | + if ( isset( $config[ 'description' ] ) && '' !== $config[ 'description' ] ) { |
|
80 | + $vars[ 'description' ] = esc_textarea( $config[ 'description' ] ); |
|
81 | 81 | } |
82 | 82 | |
83 | - if ( ! empty( $vars['logoImage'] ) || ! empty( $vars['description'] ) ) { |
|
83 | + if ( ! empty( $vars[ 'logoImage' ] ) || ! empty( $vars[ 'description' ] ) ) { |
|
84 | 84 | wp_register_script( 'kirki-branding', Kirki::$url . '/modules/customizer-branding/branding.js', array(), KIRKI_VERSION ); |
85 | 85 | wp_localize_script( 'kirki-branding', 'kirkiBranding', $vars ); |
86 | 86 | wp_enqueue_script( 'kirki-branding' ); |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | $family = $this->value; |
28 | 28 | $backup = ''; |
29 | - if ( is_array( $this->value ) && isset( $this->value[0] ) && isset( $this->value[1] ) ) { |
|
30 | - $family = $this->value[0]; |
|
31 | - $backup = $this->value[1]; |
|
29 | + if ( is_array( $this->value ) && isset( $this->value[ 0 ] ) && isset( $this->value[ 1 ] ) ) { |
|
30 | + $family = $this->value[ 0 ]; |
|
31 | + $backup = $this->value[ 1 ]; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // Make sure the value is a string. |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | // Add backup font. |
44 | 44 | if ( Kirki_Fonts::is_google_font( $family ) ) { |
45 | 45 | |
46 | - if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ]['category'] ] ) ) { |
|
47 | - $backup = $backup_fonts[ $google_fonts_array[ $family ]['category'] ]; |
|
46 | + if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ][ 'category' ] ] ) ) { |
|
47 | + $backup = $backup_fonts[ $google_fonts_array[ $family ][ 'category' ] ]; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Add double quotes if needed. |
@@ -42,8 +42,8 @@ |
||
42 | 42 | if ( false !== strpos( $this->value, ' ' ) ) { |
43 | 43 | $xy = explode( ' ', $this->value ); |
44 | 44 | |
45 | - $x = trim( $xy[0] ); |
|
46 | - $y = trim( $xy[1] ); |
|
45 | + $x = trim( $xy[ 0 ] ); |
|
46 | + $y = trim( $xy[ 1 ] ); |
|
47 | 47 | |
48 | 48 | // If x is not left/center/right, we need to sanitize it. |
49 | 49 | if ( ! in_array( $x, $x_dimensions, true ) ) { |
@@ -21,8 +21,8 @@ |
||
21 | 21 | */ |
22 | 22 | protected function process_value() { |
23 | 23 | |
24 | - if ( is_array( $this->value ) && isset( $this->value['url'] ) ) { |
|
25 | - $this->value = $this->value['url']; |
|
24 | + if ( is_array( $this->value ) && isset( $this->value[ 'url' ] ) ) { |
|
25 | + $this->value = $this->value[ 'url' ]; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) { |
@@ -26,28 +26,28 @@ |
||
26 | 26 | foreach ( $value as $key => $sub_value ) { |
27 | 27 | |
28 | 28 | // If "element" is not defined, there's no reason to continue. |
29 | - if ( ! isset( $output['element'] ) ) { |
|
29 | + if ( ! isset( $output[ 'element' ] ) ) { |
|
30 | 30 | continue; |
31 | 31 | } |
32 | 32 | |
33 | 33 | // If the "choice" is not the same as the $key in our loop, there's no reason to proceed. |
34 | - if ( isset( $output['choice'] ) && $key !== $output['choice'] ) { |
|
34 | + if ( isset( $output[ 'choice' ] ) && $key !== $output[ 'choice' ] ) { |
|
35 | 35 | continue; |
36 | 36 | } |
37 | 37 | |
38 | 38 | // If "property" is not defined, fallback to the $key. |
39 | - $property = ( ! isset( $output['property'] ) || empty( $output['property'] ) ) ? $key : $output['property']; |
|
39 | + $property = ( ! isset( $output[ 'property' ] ) || empty( $output[ 'property' ] ) ) ? $key : $output[ 'property' ]; |
|
40 | 40 | |
41 | 41 | // If "media_query" is not defined, use "global". |
42 | - if ( ! isset( $output['media_query'] ) || empty( $output['media_query'] ) ) { |
|
43 | - $output['media_query'] = 'global'; |
|
42 | + if ( ! isset( $output[ 'media_query' ] ) || empty( $output[ 'media_query' ] ) ) { |
|
43 | + $output[ 'media_query' ] = 'global'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // If "suffix" is defined, add it to the value. |
47 | - $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
|
47 | + $output[ 'suffix' ] = ( isset( $output[ 'suffix' ] ) ) ? $output[ 'suffix' ] : ''; |
|
48 | 48 | |
49 | 49 | // Create the styles. |
50 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix']; |
|
50 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $sub_value . $output[ 'suffix' ]; |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function process_output( $output, $value ) { |
25 | 25 | |
26 | - if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) { |
|
26 | + if ( ! isset( $output[ 'element' ] ) || ! isset( $output[ 'property' ] ) ) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | $output = wp_parse_args( $output, array( |
@@ -33,16 +33,16 @@ discard block |
||
33 | 33 | 'suffix' => '', |
34 | 34 | ) ); |
35 | 35 | if ( is_array( $value ) ) { |
36 | - if ( isset( $output['choice'] ) && $output['choice'] ) { |
|
37 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value[ $output['choice'] ] ) . $output['units'] . $output['suffix']; |
|
36 | + if ( isset( $output[ 'choice' ] ) && $output[ 'choice' ] ) { |
|
37 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ $output[ 'choice' ] ] ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
38 | 38 | return; |
39 | 39 | } |
40 | - if ( isset( $value['url'] ) ) { |
|
41 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix']; |
|
40 | + if ( isset( $value[ 'url' ] ) ) { |
|
41 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value[ 'url' ] ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | return; |
45 | 45 | } |
46 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; |
|
46 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $output[ 'property' ] ] = $output[ 'prefix' ] . $this->process_property_value( $output[ 'property' ], $value ) . $output[ 'units' ] . $output[ 'suffix' ]; |
|
47 | 47 | } |
48 | 48 | } |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | $upload_dir = wp_upload_dir(); |
54 | 54 | |
55 | 55 | $paths = array( |
56 | - 'file' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css/styles.css' ), |
|
57 | - 'folder' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css' ), |
|
56 | + 'file' => wp_normalize_path( $upload_dir[ 'basedir' ] . '/kirki-css/styles.css' ), |
|
57 | + 'folder' => wp_normalize_path( $upload_dir[ 'basedir' ] . '/kirki-css' ), |
|
58 | 58 | ); |
59 | 59 | |
60 | 60 | if ( 'file' === $context ) { |
61 | - return $paths['file']; |
|
61 | + return $paths[ 'file' ]; |
|
62 | 62 | } |
63 | 63 | if ( 'folder' === $context ) { |
64 | - return $paths['folder']; |
|
64 | + return $paths[ 'folder' ]; |
|
65 | 65 | } |
66 | 66 | return $paths; |
67 | 67 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function get_url() { |
78 | 78 | |
79 | 79 | $upload_dir = wp_upload_dir(); |
80 | - return esc_url_raw( $upload_dir['baseurl'] . '/kirki-css/styles.css' ); |
|
80 | + return esc_url_raw( $upload_dir[ 'baseurl' ] . '/kirki-css/styles.css' ); |
|
81 | 81 | |
82 | 82 | } |
83 | 83 |
@@ -89,15 +89,15 @@ |
||
89 | 89 | |
90 | 90 | // Parse sections and find ones with icons. |
91 | 91 | foreach ( $sections as $section ) { |
92 | - if ( isset( $section['icon'] ) ) { |
|
93 | - $this->add_icon( $section['id'], $section['icon'], 'section' ); |
|
92 | + if ( isset( $section[ 'icon' ] ) ) { |
|
93 | + $this->add_icon( $section[ 'id' ], $section[ 'icon' ], 'section' ); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | 97 | // Parse panels and find ones with icons. |
98 | 98 | foreach ( $panels as $panel ) { |
99 | - if ( isset( $panel['icon'] ) ) { |
|
100 | - $this->add_icon( $panel['id'], $panel['icon'], 'panel' ); |
|
99 | + if ( isset( $panel[ 'icon' ] ) ) { |
|
100 | + $this->add_icon( $panel[ 'id' ], $panel[ 'icon' ], 'panel' ); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 |