@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $fonts_to_load = $this->googlefonts->fonts; |
| 88 | 88 | |
| 89 | 89 | if ( ! empty( $fonts_to_load ) && 'preconnect' === $relation_type ) { |
| 90 | - $urls[] = array( |
|
| 90 | + $urls[ ] = array( |
|
| 91 | 91 | 'href' => 'https://fonts.gstatic.com', |
| 92 | 92 | 'crossorigin', |
| 93 | 93 | ); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value ); |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | - $this->fonts_to_load[] = $font . ':' . join( ',', $weights ) . ':cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai'; |
|
| 123 | + $this->fonts_to_load[ ] = $font . ':' . join( ',', $weights ) . ':cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai'; |
|
| 124 | 124 | } |
| 125 | 125 | if ( ! empty( $this->fonts_to_load ) ) { |
| 126 | 126 | Kirki_Modules_Webfont_Loader::$load = true; |
@@ -39,18 +39,18 @@ |
||
| 39 | 39 | |
| 40 | 40 | foreach ( array_keys( $value ) as $key ) { |
| 41 | 41 | |
| 42 | - $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key; |
|
| 43 | - if ( isset( $output['choice'] ) && $output['property'] ) { |
|
| 44 | - if ( $key === $output['choice'] ) { |
|
| 45 | - $property = $output['property']; |
|
| 42 | + $property = ( empty( $output[ 'property' ] ) ) ? $key : $output[ 'property' ] . '-' . $key; |
|
| 43 | + if ( isset( $output[ 'choice' ] ) && $output[ 'property' ] ) { |
|
| 44 | + if ( $key === $output[ 'choice' ] ) { |
|
| 45 | + $property = $output[ 'property' ]; |
|
| 46 | 46 | } else { |
| 47 | 47 | continue; |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | - if ( false !== strpos( $output['property'], '%%' ) ) { |
|
| 51 | - $property = str_replace( '%%', $key, $output['property'] ); |
|
| 50 | + if ( false !== strpos( $output[ 'property' ], '%%' ) ) { |
|
| 51 | + $property = str_replace( '%%', $key, $output[ 'property' ] ); |
|
| 52 | 52 | } |
| 53 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix']; |
|
| 53 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $this->process_property_value( $property, $value[ $key ] ) . $output[ 'suffix' ]; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -149,39 +149,39 @@ |
||
| 149 | 149 | // Get the basics from the parent class. |
| 150 | 150 | parent::to_json(); |
| 151 | 151 | // Default. |
| 152 | - $this->json['default'] = $this->setting->default; |
|
| 152 | + $this->json[ 'default' ] = $this->setting->default; |
|
| 153 | 153 | if ( isset( $this->default ) ) { |
| 154 | - $this->json['default'] = $this->default; |
|
| 154 | + $this->json[ 'default' ] = $this->default; |
|
| 155 | 155 | } |
| 156 | 156 | // Required. |
| 157 | - $this->json['required'] = $this->required; |
|
| 157 | + $this->json[ 'required' ] = $this->required; |
|
| 158 | 158 | // Output. |
| 159 | - $this->json['output'] = $this->output; |
|
| 159 | + $this->json[ 'output' ] = $this->output; |
|
| 160 | 160 | // Value. |
| 161 | - $this->json['value'] = $this->value(); |
|
| 161 | + $this->json[ 'value' ] = $this->value(); |
|
| 162 | 162 | // Choices. |
| 163 | - $this->json['choices'] = $this->choices; |
|
| 163 | + $this->json[ 'choices' ] = $this->choices; |
|
| 164 | 164 | // The link. |
| 165 | - $this->json['link'] = $this->get_link(); |
|
| 165 | + $this->json[ 'link' ] = $this->get_link(); |
|
| 166 | 166 | // The ID. |
| 167 | - $this->json['id'] = $this->id; |
|
| 167 | + $this->json[ 'id' ] = $this->id; |
|
| 168 | 168 | // Translation strings. |
| 169 | - $this->json['l10n'] = $this->l10n(); |
|
| 169 | + $this->json[ 'l10n' ] = $this->l10n(); |
|
| 170 | 170 | // The ajaxurl in case we need it. |
| 171 | - $this->json['ajaxurl'] = admin_url( 'admin-ajax.php' ); |
|
| 171 | + $this->json[ 'ajaxurl' ] = admin_url( 'admin-ajax.php' ); |
|
| 172 | 172 | // Input attributes. |
| 173 | - $this->json['inputAttrs'] = ''; |
|
| 173 | + $this->json[ 'inputAttrs' ] = ''; |
|
| 174 | 174 | foreach ( $this->input_attrs as $attr => $value ) { |
| 175 | - $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
| 175 | + $this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
| 176 | 176 | } |
| 177 | 177 | // The kirki-config. |
| 178 | - $this->json['kirkiConfig'] = $this->kirki_config; |
|
| 178 | + $this->json[ 'kirkiConfig' ] = $this->kirki_config; |
|
| 179 | 179 | // The option-type. |
| 180 | - $this->json['kirkiOptionType'] = $this->option_type; |
|
| 180 | + $this->json[ 'kirkiOptionType' ] = $this->option_type; |
|
| 181 | 181 | // The option-name. |
| 182 | - $this->json['kirkiOptionName'] = $this->option_name; |
|
| 182 | + $this->json[ 'kirkiOptionName' ] = $this->option_name; |
|
| 183 | 183 | // The preset. |
| 184 | - $this->json['preset'] = $this->preset; |
|
| 184 | + $this->json[ 'preset' ] = $this->preset; |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Apply the kirki_config filter. |
| 64 | 64 | $config = apply_filters( 'kirki_config', array() ); |
| 65 | - if ( isset( $config['url_path'] ) ) { |
|
| 66 | - Kirki::$url = $config['url_path']; |
|
| 65 | + if ( isset( $config[ 'url_path' ] ) ) { |
|
| 66 | + Kirki::$url = $config[ 'url_path' ]; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Make sure the right protocol is used. |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $this->control_types = $this->default_control_types(); |
| 145 | 145 | if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) { |
| 146 | - unset( $this->control_types['code_editor'] ); |
|
| 146 | + unset( $this->control_types[ 'code_editor' ] ); |
|
| 147 | 147 | } |
| 148 | 148 | foreach ( $this->control_types as $key => $classname ) { |
| 149 | 149 | if ( ! class_exists( $classname ) ) { |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | if ( ! empty( Kirki::$panels ) ) { |
| 175 | 175 | foreach ( Kirki::$panels as $panel_args ) { |
| 176 | 176 | // Extra checks for nested panels. |
| 177 | - if ( isset( $panel_args['panel'] ) ) { |
|
| 178 | - if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { |
|
| 177 | + if ( isset( $panel_args[ 'panel' ] ) ) { |
|
| 178 | + if ( isset( Kirki::$panels[ $panel_args[ 'panel' ] ] ) ) { |
|
| 179 | 179 | // Set the type to nested. |
| 180 | - $panel_args['type'] = 'kirki-nested'; |
|
| 180 | + $panel_args[ 'type' ] = 'kirki-nested'; |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | if ( ! empty( Kirki::$sections ) ) { |
| 196 | 196 | foreach ( Kirki::$sections as $section_args ) { |
| 197 | 197 | // Extra checks for nested sections. |
| 198 | - if ( isset( $section_args['section'] ) ) { |
|
| 199 | - if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { |
|
| 198 | + if ( isset( $section_args[ 'section' ] ) ) { |
|
| 199 | + if ( isset( Kirki::$sections[ $section_args[ 'section' ] ] ) ) { |
|
| 200 | 200 | // Set the type to nested. |
| 201 | - $section_args['type'] = 'kirki-nested'; |
|
| 201 | + $section_args[ 'type' ] = 'kirki-nested'; |
|
| 202 | 202 | // We need to check if the parent section is nested inside a panel. |
| 203 | - $parent_section = Kirki::$sections[ $section_args['section'] ]; |
|
| 204 | - if ( isset( $parent_section['panel'] ) ) { |
|
| 205 | - $section_args['panel'] = $parent_section['panel']; |
|
| 203 | + $parent_section = Kirki::$sections[ $section_args[ 'section' ] ]; |
|
| 204 | + if ( isset( $parent_section[ 'panel' ] ) ) { |
|
| 205 | + $section_args[ 'panel' ] = $parent_section[ 'panel' ]; |
|
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | } |