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
- Cache API Images to Prevent Hot Linking
- WordPress Media Uploader not displaying image that has just been uploaded
- Multimedia upload error in my wordpress job board plugin
- Downloading File via headers doesnt work
- get the permalink error
- Creating an ics calendar from custom post type
- Why does “updated_post_meta” did not fire when uploading media other than image?
- Catch metabox values in Plugin
- Cannot output plugin twice with shortcode
- Exclude Woocommerce Product Category From Sitemap
- How to make an admin plugin menu page go full screen?
- want to show CMB2 metabox on woocommerce product data tab
- wp_schedule_single_event is set correctly but sometimes not fired
- Dynamic page generation upon purchase of a product
- Customise Grouped Product display in Woocommerce with custom column
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- How to re-house images in uploads/YYYY/MM
- Why is $_POST empty when saving custom Meta Box?
- Creating posts with links from a txt file
- WordPress video js error this.mediaElement.play is not a function
- It is possible to pass $args that sent by add_settings_field() inside another function?
- How to Get Last ID?
- Change reminder email date to 14 days before
- Console errors in 6.0-RC1 Widget screen
- Custom Icon for Plugin
- Change the behaviour of a button
- WP_Query order posts by category
- Custom Block Not Shown in Block Inserter
- How to override supports of innerBlocks?
- Login page too many redirects
- Set the payment processor callbacks to a plugin
- Configuring Xdebug with docker compose
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Remove duplicate media entries from mysql database
- Paragraph Tags removed when contents are only a shortcode
- how to show youtube comment profile pic in wordpress
- When I activate my custom plugin the menus and some styling of my site is messed up
- How to create archive page to add in menu
- Make a php array load faster
- Simulating timeout is not working
- Add multiple checkboxes as single field to Custom Shipping Method Settings Page
- Import images remotly run through timeout error
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Custom payment method after payment user is logged out on thank you page
- Load specific page when a custom URL is hit
- The URL of images on my website changed after being set as featured image
- Allow REST API Endpoint to specific user and hide from public
- How to use attributes in competent of Gutenberg
- Ajax on the Administration Side of plugin – returns 0
- get all images from the wordpress media library with link to the post they are associated with