Home › Forums › General Issues › Audio playlist field › Reply To: Audio playlist field
Many thanks for the info.
The following works perfectly:
add_filter( 'ajax_query_attachments_args', 'show_audio_attachments', 10, 1 );
function show_audio_attachments( $query=array() ) {
if( $_POST['query']['_acfuploader'] && $_POST['query']['_acfuploader'] == 'field_589471f6b171a' ) {
$query['post_mime_type'] = 'audio';
}
return $query;
}
The downside may be is that it relies on hard coded field reference, but if I’m to change the fields structure I’ll have other problems to deal with anyways.
Also I have to make it work with Media Library Assistant plugin.
I’ll keep you posted…
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.