Dev

Lyrics Support (Incomplete)

We edited  templates/form/upload.php via child theme and added the following code to edit the upload form. From line 181 to 184

	<p class="form-upload-lyrics">
    <label><?php esc_html_e('Lyrics', 'play-block'); ?></label>
    <textarea name="lyrics" class="input" rows="6"><?php echo esc_textarea( get_post_meta( $post->ID, 'lyrics', true ) ); ?></textarea>
</p>

To save the lyrics submitted, we added the snippet

add_action( 'init', function () {
	if ( ! isset( $_POST['lyrics'] ) || empty( $_POST['post_id'] ) ) {
		return;
	}

	// Optional: Add nonce check if your form includes it
	if ( isset( $_POST['lyrics_nonce'] ) && ! wp_verify_nonce( $_POST['lyrics_nonce'], 'save_lyrics_action' ) ) {
		return;
	}

	// Make sure it's a valid post ID and the user has permission
	$post_id = absint( wp_unslash( $_POST['post_id'] ) );

	if ( get_post_type( $post_id ) !== 'station' ) {
		return;
	}

	$lyrics = sanitize_textarea_field( wp_unslash( $_POST['lyrics'] ) );
	update_post_meta( $post_id, 'lyrics', $lyrics );
} );
Sponsored

Adds lyrics to the Stations page by editing inc/play-functions.php directly

//Adds Lyrics Button to Station Page
add_action( 'play_single_meta', 'play_output_lyrics_button', 25 ); // Priority 25 puts it before like/buy

function play_output_lyrics_button() {
    $lyrics = get_post_meta( get_the_ID(), 'lyrics', true );

    if ( ! empty( $lyrics ) ) {
        echo '<button id="show-lyrics" class="lyrics-button" title="Show Lyrics">
    <img src="https://zanany.com/wp-content/uploads/2025/07/microphone_18331415.png" alt="Lyrics" style="width:20px; height:20px;">
</button>';

    }