Call a custom field in an audio shortcode?

I’m attempting to call a custom field in an audio shortcode. The field I’m calling, enclosure, defines MP3 files that are associated with my respective posts. I’m using the PHP template editor in WordPress. Here’s what I have. <?php echo do_shortcode(”);?> I would like to insert the following code in place of the word “enclosure.” … Read more

Audio or playlist shortcode condition according to the amount of files on attachment page

My reason for doing this is for a music & entertainment site where users will have the ability to share music and videos on other websites via embed code. I’m using the audio.php and video.php attachment pages to load the default MediaElement.js HTML5 Player with all the attached media from it’s parent post. I then … Read more

How can I list URLs of all audio files within my media gallery?

I have a music player in my theme that generates its playlist from a javascript file that looks like this var myPlaylist = [ { mp3:’track url goes here’, title:’title here’, artist:’artist’, } { mp3:’track url goes here’, title:’title here’, artist:’artist’, } etc… ]; How can I query the media library so it will echo … Read more

Is wp_read_audio_metadata() function deprecated?

I am trying to use the function wp_read_audio_metadata() to read the metadata for an mp3 file uploaded to a post using acf’s file field. Below is my code: <?php $audio_file = get_field(‘archive_audio_file’); $audio_file_id = $audio_file[‘id’]; $audio_file_path = get_attached_file( $audio_file_id); var_dump(wp_read_audio_metadata($audio_file_path)); ?> When using that code I receive this error on the front end: Fatal error: … Read more

How to remove hardcoded characters from playlists?

I’m working on a WordPress theme for a website that makes heavy use of its default media player. In the process of styling its playlists, I found that a core file injects hardcoded characters that can’t be made invisible just by using CSS, so I’m a bit clueless about how to hide/remove them. These characters … Read more