diff --git a/retro-webamp-block.php b/retro-webamp-block.php index 4a08d47..6a417de 100644 --- a/retro-webamp-block.php +++ b/retro-webamp-block.php @@ -110,8 +110,8 @@ function ( $block_content, $block, $instance ) { if ( 'core/audio' !== $block['blockName'] ) { return $block_content; } - $attributes = $block['attrs'] ?? array(); - $attachment_id = $attributes['id'] ?? 0; + $attributes = isset( $block['attrs'] ) ? $block['attrs'] : array(); + $attachment_id = isset( $attributes['id'] ) ? $attributes['id'] : 0; $attachment = get_post( $attachment_id ); // Stop here if $attachment can't be found. @@ -120,8 +120,8 @@ function ( $block_content, $block, $instance ) { } $metadata = wp_get_attachment_metadata( $attachment_id ); - $artist = $metadata['artist'] ?? ''; - $title = $metadata['title'] ?? ''; + $artist = isset( $metadata['artist'] ) ? $metadata['artist'] : ''; + $title = isset( $metadata['title'] ) ? $metadata['title'] : ''; $new_props = array( 'artist' => $artist, 'title' => $title,