The WordPress All In One Music Player is a collection of music players for your WordPress site where you can choose your favorite music player to play the music files. In case you haven’t added the music player yet, here’s how to add your favorite music player to your site.

By default, the All In One Music Player plays all the music files found in your media library. That’s cool. However, in some cases, you might only want to play a single specific music file. You can accomplish that with a little custom code which I’ve included below:

add_filter(
	'all_in_one_music_player_audio_files_data',
	function( $audio ) {

		$audio = array(
			array(
				'artist'        => 'The Shadows',
				'song'          => 'Prakriti',
				'name'          => 'Prakriti',
				'url'           => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/10/bensound-happyrock.mp3',
				'cover_art_url' => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/06/All-in-one-music-player.png',
				'cover'         => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/06/All-in-one-music-player.png',
				'length'        => '4:30',
			),
		);

		return $audio;
	}
);


You’ll need to modify the values out there as per your requirement and you’re all set.

In case it helps, here’s how to easily add custom codes to your WordPress site.

I hope this helps!

Add music files via URL in the WordPress All in One Music Player plugin

Sanjeev Aryal

Don't bury your thoughts, put your vision into reality ~ Bob Marley.

Leave a Reply

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

Pin It on Pinterest