| @@ -26,13 +26,14 @@ | ||
| 26 | 26 | if ( $block instanceof WP_Block && isset( $block->context['showImages'] ) ) { |
| 27 | 27 | $show_images = $block->context['showImages']; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $artist = $attributes['artist'] ?? ''; | |
| 31 | - $image = $attributes['image'] ?? ''; | |
| 32 | - $alt = $attributes['imageAlt'] ?? ''; | |
| 33 | - $length = $attributes['length'] ?? ''; | |
| 34 | - $title = isset( $attributes['title'] ) && ! empty( $attributes['title'] ) ? $attributes['title'] : __( 'Unknown title' ); | |
| 30 | + $track_image = $attributes['image'] ?? null; | |
| 31 | + $image = is_string( $track_image ) ? $track_image : ''; | |
| 32 | + $artist = $attributes['artist'] ?? ''; | |
| 33 | + $alt = $attributes['imageAlt'] ?? ''; | |
| 34 | + $length = $attributes['length'] ?? ''; | |
| 35 | + $title = isset( $attributes['title'] ) && ! empty( $attributes['title'] ) ? $attributes['title'] : __( 'Unknown title' ); | |
| 35 | 36 | |
| 36 | 37 | $html = '<li ' . $wrapper_attributes . '>'; |
| 37 | 38 | $html .= '<button data-wp-on--click="actions.changeTrack" data-wp-bind--aria-current="state.isCurrentTrack" class="wp-block-playlist-track__button">'; |
| 38 | 39 | |