| @@ -164,19 +164,19 @@ | ||
| 164 | 164 | ); |
| 165 | 165 | |
| 166 | 166 | $instance = $old_instance; |
| 167 | 167 | |
| 168 | - $instance['title'] = wp_strip_all_tags( $new_instance['title'] ); | |
| 169 | - $instance['img_url'] = esc_url( trim( $new_instance['img_url'] ) ); | |
| 170 | - $instance['alt_text'] = wp_strip_all_tags( $new_instance['alt_text'] ); | |
| 171 | - $instance['img_title'] = wp_strip_all_tags( $new_instance['img_title'] ); | |
| 172 | - $instance['caption'] = wp_kses( stripslashes( $new_instance['caption'] ), $allowed_caption_html ); | |
| 173 | - $instance['align'] = $new_instance['align']; | |
| 174 | - $instance['link'] = esc_url( trim( $new_instance['link'] ) ); | |
| 168 | + $instance['title'] = wp_strip_all_tags( $new_instance['title'] ?? '' ); | |
| 169 | + $instance['img_url'] = esc_url( trim( $new_instance['img_url'] ?? '' ) ); | |
| 170 | + $instance['alt_text'] = wp_strip_all_tags( $new_instance['alt_text'] ?? '' ); | |
| 171 | + $instance['img_title'] = wp_strip_all_tags( $new_instance['img_title'] ?? '' ); | |
| 172 | + $instance['caption'] = wp_kses( stripslashes( $new_instance['caption'] ?? '' ), $allowed_caption_html ); | |
| 173 | + $instance['align'] = $new_instance['align'] ?? 'none'; | |
| 174 | + $instance['link'] = esc_url( trim( $new_instance['link'] ?? '' ) ); | |
| 175 | 175 | $instance['link_target_blank'] = isset( $new_instance['link_target_blank'] ) ? (bool) $new_instance['link_target_blank'] : false; |
| 176 | 176 | |
| 177 | - $new_img_width = absint( $new_instance['img_width'] ); | |
| 178 | - $new_img_height = absint( $new_instance['img_height'] ); | |
| 177 | + $new_img_width = absint( $new_instance['img_width'] ?? 0 ); | |
| 178 | + $new_img_height = absint( $new_instance['img_height'] ?? 0 ); | |
| 179 | 179 | |
| 180 | 180 | if ( ! empty( $instance['img_url'] ) && 0 === $new_img_width && 0 === $new_img_height ) { |
| 181 | 181 | // Download the url to a local temp file and then process it with getimagesize so we can optimize browser layout. |
| 182 | 182 | $tmp_file = download_url( $instance['img_url'], 10 ); |