Yes, it’s possible in the same manner as before. I don’t know why you think the filter is not passing the parameters anymore.
add_filter('attachment_fields_to_edit', 'user16975_edit_fields', 10, 2);
function user16975_edit_fields($form_fields, $attachment){
// check for an audio attachment
if ( substr($attachment->post_mime_type, 0, 5) == 'audio' ) {
$playertag = $playertag = "";
$form_fields["audioplayer"] = array(
"label" => "Audio player",
"input" => "html",
"html" => "<button type="button" class="button" data-link-url="$playertag" audioplayer="audio-player-{$attachment->ID}">Audio Player</button>",
);
}
return $form_fields;
}
Here is the result :

Related Posts:
- Enhance Media Manager for Gallery
- Change Media Uploader default directory
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- How to replicate Media Library “Add New” on Plugin Settings Page
- Thumbnails for media Library images
- upload image to wordpress media library failed for custom post type
- Custom collection in media manager?
- Checking if a file is already in the Media Library
- Adding more options to the instance of an image. (Attachment Display Settings)
- Saving data-URI to media library
- Can I use the wp media uploader for my own plugin?
- Customizing the 3.5 “Add Media” popup (Backbone.js)
- Replace audio/video enclosure with player?
- Mediaelement.js feature doesn’t work
- How can I view all WP generated thumbnails in Media Manager?
- WordPress Media mime type filter problem 4.0
- Bridge WordPress Media API with custom tinyMCE plugin [closed]
- How to get an image transferred via FTP or script to appear in Media Manager?
- Add Additional File Info (jpeg compression & file size) settings to Edit Images Screen
- Is it possible to modify the media library admin screen?
- Using the component outside the editor. select(‘core’) is null
- What filter should I use to insert a button inside on Media>Add New
- How to enable sorting in custom media uploader in plugin
- Create a new post using rest api and save featured image using an external image url
- Capture mediaelement events
- PowerPress mobile media player
- Upload multiple images and insert them into custom html code
- wp_editor add media button not working
- Run a function when new image is uploaded in media library
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- wp.media Uncaught TypeError: Cannot read properties of undefined (reading ‘state’)
- wp.media libary pdf type
- How to create wordpress media library UI on plugin page
- wp.media gallery collection sometimes undefined
- Can’t load a script in my plugin page
- function add custom fields to media gallery
- Default media uploader is not showing in wordpress website
- WordPress Dropdown image select
- Changed media upload path for plugin, but generates error & shows wrong url
- How to destroy or dispose wordpress uploder/manager?
- Dynamic banner for use on external sites
- Creating custom Insert Media page
- Remove image in post when it’s removed in media library
- How do you filter get_media_items by mime type in a custom media upload tab?
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Open media box library from link
- Upload to a specific media folder created by FileBird Lite
- Load images from CDN and custom features to “Add Media” dialogue
- audio tags no longer working
- wp media uploader and ID3 tags
- WordPress Media Uploader not displaying image that has just been uploaded
- Insert/Update values to a table after blogname option etc. is updated
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- How to add a widget to the post editing view?
- WordPress debug messages not displaying
- Show message from backend
- Cannot change caption for a plugin
- Remove all removed pages from wordpress
- A link (not in the post) to download a specific PDF file
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Woocommerce inventory [closed]
- how to load the comment template from a plugin
- Change/Set Page Title and Meta Tags from Page Called within a Plugin
- Look for a file in a theme before loading from plugin
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- when i activate my plugin i want to auto create pages with shortcodes
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- How can I prevent ‘500 internal server error’ because of a long install process?
- How to display TinyMCE HTML view?
- Displaying custom content from a plugin within the active theme
- Downloading File via headers doesnt work
- get the permalink error
- Why does “updated_post_meta” did not fire when uploading media other than image?
- How to copy the all WordPress media items to another custom plugin folder?
- Does $this context change in an AJAX callback?
- WordPress custom url without using any of the custom tags given
- How to call a plugin function from a page
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- If user is logged-in display/hide widgets ( siteorigine) [closed]
- Javascript not being loaded only in custom taxonomy template
- User Registration Moderate
- pull data from wordpress database
- Implementing Select2 plugin into WordPress
- Object Oriented plugin, add action and variables
- Why user is added back in database after deletion?
- add_action priority and taxonomy used in plugin
- Missing Images in Uploads Directory (Server Only)
- Tracing dashboard publish settings from input form in WordPress
- Post data in wp-admin to external database
- Virtual Page with Registration form
- Pictures won’t display in media library and also won’t show preview when selected
- Images not displaying on live server
- redirect word-press page with page values
- How to only Load scripts on variable products page
- Forcing the Uninstall Hook to fail
- How to display .ptm file in my WP site without JAVA
- Getting similar posts by custom field value
- Does WP REST API cache internally executed (rest_do_request) requests?
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- ‘useSate’ error when using React on the frontend in custom block plugin