The [WordPress] world has enough hate dislike for the Block Editor (ask Tony Hirst). I like it better when a work around works.

In my OE Global work I’ve been working on a podcast series, and saw a need to generate audio playlists for different groups of episodes. I remember doing playlists in raw HTML, it looks like in the present case of WordPress (see a reference) you either use the Classic Editor (Add Media button options for creating audio playlists) or some hand inserting of audio media IDs.

I had never done playlists in WordPress, and would prefer not reaching for Yet Another Plugin, so dug in and found the backdoor.

Here’s a demo of just some family audio stories I found in my Media Library

When you use the Audio block, the only option you have is to insert single audio tracks, either by uploading to the Media Library or by referencing a remote URL.

So the backdoor is to use the Classic Block to Get The Old Editor Again. The clicking the Add Media button presents the old interface where you can choose to create galleries (for images) or playlists for Audio.

The buttons of the classic editpr with a red arrow pointing to the Add Media button - it has an icon of a camera and music notes

Hello Old Media Interface!

The Add Media interface with option on left for Create Audio Playlist is highlighted in a red box

From here the media selector filters out just your audio content. I fished around and found 4 audio clips of conversations with family members. I knew I had more, but I remember that many I had manually updated to an /audio sub directory of my wp-content one (I forget why).

Selecting three of about 84 audio files, all selected ones have a check mark next to them.

Before I insert, I use the left side option to Edit Audio Playlist– here I can re-arrange the order by dragging the icons around.

The four icons for my selected audio shown in the Edit Audio Playlist interface- I can click and drag them to arrange the order they will be played in.

Then when I click Insert audio playlist I see it in the classic editor.

The block editor shows an audio playlist with four items in- some have full titles, but others have titles like --granny-childhood

The titles and names come from the audio metadata,and I can see being sloppy as the second and third items have titles that just come from the mp3 file name. These can be edited in the Media Library by changing their title (other meta data fields can be edited below).

This will work for the purposes I need, but it’s good to know there is a native WordPress way to create audio playlists, even if you need to use the Classic Back Door. Maybe one day there will be a block for this, but until then– this works.


Featured Image: Edited door sign to feature WordPress icon and text “Audio Playlists” from The Back Door flickr photo by Cliff Johnson shared under a Creative Commons (BY-SA) license so I share thus under the same license.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *