context['showImages'] ) ) { $show_images = $block->context['showImages']; } $track_image = $attributes['image'] ?? null; $image = is_string( $track_image ) ? $track_image : ''; $artist = $attributes['artist'] ?? ''; $alt = $attributes['imageAlt'] ?? ''; $length = $attributes['length'] ?? ''; $title = isset( $attributes['title'] ) && ! empty( $attributes['title'] ) ? $attributes['title'] : __( 'Unknown title' ); $html = '
  • '; $html .= ''; $html .= '
  • '; return $html; } /** * Registers the `core/playlist-track` block on server. * * @since 7.1.0 */ function gutenberg_register_block_core_playlist_track() { register_block_type_from_metadata( __DIR__ . '/playlist-track', array( 'render_callback' => 'gutenberg_render_block_core_playlist_track', ) ); } add_action( 'init', 'gutenberg_register_block_core_playlist_track', 20 );