I read this thread here that offers a filter for changing MediaElement.js settings in WordPress, and I am looking to do something similar only I don't need to target all of the
MediaElement.js script, only the
wp-playlist.js (and probably
The reason is because I am trying to add a download link to audio files in a WordPress playlist while keeping it on the same row as the title and file duration. I followed the steps in the previous thread and was successful in getting the same results. However, the answer by birgire included a suggestion for further customization in which he said:
You might also consider enqueuing your own version of the
wp-playlist.jsfile where you replace:
'click .wp-playlist-item' : 'clickTrack',
with for example:
'click a.wp-playlist-item-caption' : 'clickTrack',
to be able to have the download link in the same row as the song title.
Unfortunately, I am not an coding expert and my attempts at enqueuing the
wp-playlist.js file ended up (1) having either no affect or - sometimes - (2) breaking the playlist in place or (3) breaking the whole website.
I did consider playing with the css code in the playlist template but found it to be a hassle. It will work, with time and trial and error, and I am not saying it's not worth the time and effort, but (despite my limited experience) I feel that there must be a very simple filter or function that can achieve the same result.
So, to rephrase my question: Can the core wp-playlist.js events be modified in a child template or plugin using a filter? If yes, how?
And specifically, can the css class in this event
'click .wp-playlist-item' : 'clickTrack', be modified with a filter? If yes, please outline how.
Thank you for your time and patience.