@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $fonts_to_load = $this->googlefonts->fonts; |
| 78 | 78 | |
| 79 | 79 | if ( ! empty( $fonts_to_load ) && 'preconnect' === $relation_type ) { |
| 80 | - $urls[] = array( |
|
| 80 | + $urls[ ] = array( |
|
| 81 | 81 | 'href' => 'https://fonts.gstatic.com', |
| 82 | 82 | 'crossorigin', |
| 83 | 83 | ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value ); |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | - $fonts_to_load[] = $font . ':' . join( ',', $weights ); |
|
| 114 | + $fonts_to_load[ ] = $font . ':' . join( ',', $weights ); |
|
| 115 | 115 | } |
| 116 | 116 | wp_enqueue_script( 'webfont-loader', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), KIRKI_VERSION ); |
| 117 | 117 | if ( empty( $fonts_to_load ) ) { |
@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | * @access protected |
| 60 | 60 | */ |
| 61 | 61 | protected function set_choices() { |
| 62 | - if ( ! isset( $this->choices['language'] ) ) { |
|
| 62 | + if ( ! isset( $this->choices[ 'language' ] ) ) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | - $language = $this->choices['language']; |
|
| 65 | + $language = $this->choices[ 'language' ]; |
|
| 66 | 66 | switch ( $language ) { |
| 67 | 67 | case 'json': |
| 68 | 68 | case 'xml': |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | $language = 'text/x-' . $language; |
| 91 | 91 | break; |
| 92 | 92 | } |
| 93 | - if ( ! isset( $this->editor_settings['codemirror'] ) ) { |
|
| 94 | - $this->editor_settings['codemirror'] = array(); |
|
| 93 | + if ( ! isset( $this->editor_settings[ 'codemirror' ] ) ) { |
|
| 94 | + $this->editor_settings[ 'codemirror' ] = array(); |
|
| 95 | 95 | } |
| 96 | - if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) { |
|
| 97 | - $this->editor_settings['codemirror']['mode'] = $language; |
|
| 96 | + if ( ! isset( $this->editor_settings[ 'codemirror' ][ 'mode' ] ) ) { |
|
| 97 | + $this->editor_settings[ 'codemirror' ][ 'mode' ] = $language; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | if ( ! is_array( $this->choices ) ) { |
| 61 | 61 | $this->choices = (array) $this->choices; |
| 62 | 62 | } |
| 63 | - if ( ! isset( $this->choices['save_as'] ) ) { |
|
| 64 | - $this->choices['save_as'] = 'url'; |
|
| 63 | + if ( ! isset( $this->choices[ 'save_as' ] ) ) { |
|
| 64 | + $this->choices[ 'save_as' ] = 'url'; |
|
| 65 | 65 | } |
| 66 | - if ( ! isset( $this->choices['labels'] ) ) { |
|
| 67 | - $this->choices['labels'] = array(); |
|
| 66 | + if ( ! isset( $this->choices[ 'labels' ] ) ) { |
|
| 67 | + $this->choices[ 'labels' ] = array(); |
|
| 68 | 68 | } |
| 69 | 69 | $this->set_button_labels(); |
| 70 | - $this->choices['labels'] = wp_parse_args( $this->choices['labels'], $this->button_labels ); |
|
| 70 | + $this->choices[ 'labels' ] = wp_parse_args( $this->choices[ 'labels' ], $this->button_labels ); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function sanitize( $value ) { |
| 95 | 95 | |
| 96 | - if ( isset( $this->choices['save_as'] ) && 'array' === $this->choices['save_as'] ) { |
|
| 96 | + if ( isset( $this->choices[ 'save_as' ] ) && 'array' === $this->choices[ 'save_as' ] ) { |
|
| 97 | 97 | return array( |
| 98 | - 'id' => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '', |
|
| 99 | - 'url' => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '', |
|
| 100 | - 'width' => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '', |
|
| 101 | - 'height' => ( isset( $value['height'] ) && '' !== $value['height'] ) ? (int) $value['height'] : '', |
|
| 98 | + 'id' => ( isset( $value[ 'id' ] ) && '' !== $value[ 'id' ] ) ? (int) $value[ 'id' ] : '', |
|
| 99 | + 'url' => ( isset( $value[ 'url' ] ) && '' !== $value[ 'url' ] ) ? esc_url_raw( $value[ 'url' ] ) : '', |
|
| 100 | + 'width' => ( isset( $value[ 'width' ] ) && '' !== $value[ 'width' ] ) ? (int) $value[ 'width' ] : '', |
|
| 101 | + 'height' => ( isset( $value[ 'height' ] ) && '' !== $value[ 'height' ] ) ? (int) $value[ 'height' ] : '', |
|
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | - if ( isset( $this->choices['save_as'] ) && 'id' === $this->choices['save_as'] ) { |
|
| 104 | + if ( isset( $this->choices[ 'save_as' ] ) && 'id' === $this->choices[ 'save_as' ] ) { |
|
| 105 | 105 | return absint( $value ); |
| 106 | 106 | } |
| 107 | 107 | if ( is_string( $value ) ) { |