Ive just reached the threshold where help is needed. much hoours wasted on this. :(

I'd like to upload audio files via the Gutenburg default audio block.
Here is the typical generated html :

<!-- wp:audio {"id":427} -->
<figure class="wp-block-audio"><audio controls src="link.mp3"></audio></figure>
<!-- /wp:audio -->

I'd like most importantly to remove the controls tag (to initiate a custom JS player separatly).

Tried every way possible, media.php, mediaelement.php. formatting files and strings... Then i figured i could just create a custom block, turns out that's quite complex, especially since i'm only loooking to change so little from original audio block.

While we're on the topic, how can we safely/effectively change the default class? i.e : wp-block-audio No success with addBlockClassName or the three methods displayed here : How to modify an image block in Gutenberg WordPress 5?

And at last.. can we choose to render the audio blocks inside and not ?

Thanks, any help appreciated :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.