| @@ -53,11 +53,19 @@ | ||
| 53 | 53 | if ( ! empty( $instance['title'] ) ) { |
| 54 | 54 | echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + // Deprecated since v2.5.8. Retained for backward compatibility. | |
| 57 | 58 | if ( isset( $args['widget_id'] ) ) { |
| 58 | - $instance['uid'] = md5( $args['widget_id'] ); | |
| 59 | + $instance['deprecated_uid'] = md5( $args['widget_id'] ); | |
| 59 | 60 | } |
| 61 | + | |
| 62 | + // If popup is enabled and type is video, force theme to popup | |
| 63 | + if ( isset( $instance['popup'] ) && ! empty( $instance['popup'] ) ) { | |
| 64 | + if ( isset( $instance['type'] ) && 'video' == $instance['type'] ) { | |
| 65 | + $instance['theme'] = 'popup'; | |
| 66 | + } | |
| 67 | + } | |
| 60 | 68 | |
| 61 | 69 | echo ayg_build_gallery( $instance ); |
| 62 | 70 | |
| 63 | 71 | echo $args['after_widget']; |
| @@ -89,8 +97,10 @@ | ||
| 89 | 97 | $instance[ $field_name ] = 0; |
| 90 | 98 | } |
| 91 | 99 | } elseif ( 'checkbox' == $field_type ) { |
| 92 | 100 | $instance[ $field_name ] = isset( $new_instance[ $field_name ] ) ? (int) $new_instance[ $field_name ] : 0; |
| 101 | + } elseif ( 'textarea' == $field_type ) { | |
| 102 | + $instance[ $field_name ] = ! empty( $new_instance[ $field_name ] ) ? sanitize_textarea_field( $new_instance[ $field_name ] ) : ''; | |
| 93 | 103 | } else { |
| 94 | 104 | $instance[ $field_name ] = ! empty( $new_instance[ $field_name ] ) ? sanitize_text_field( $new_instance[ $field_name ] ) : ''; |
| 95 | 105 | } |
| 96 | 106 | } |