@@ -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 ) ) { |