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
- How to add Request header in WordPress remote api calls
- Init action hook running late after PayPal’s return url?
- Get specific color from admin color scheme
- wp_remote_get doesn’t work with secure connections https?
- Attach Files Metabox
- Change WordPress.org hosted plugin readme.txt
- get_posts / WP_Query Memory size of 134217728 bytes exhausted
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Sessions not creating correctly in custom function
- Problem with `wp_mail()`
- How to add meta boxes to the ‘Add new post’ screen?
- Load WooCommerce templates from my plugin folder first
- add_menu_page() with function inside a class [duplicate]
- Overwrite default XMLRPC function from plugin
- Cannot modify header information – headers already sent by pluggable.php
- htmlentities and editing text
- Gutenberg registerFormatType with Multiple Classes
- Best way to notify WordPress plugin users of new release candidates for beta testing?
- How to update total price of completed order in woocommerce? [closed]
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Turn off Admin Bar (Toolbar) in backend – no easy way
- When to use add_settings_section vs just register_setting?
- How to customize login process
- How should I store a log for my plugin
- Adding more text to a post, after it was published
- How to modify the comments to be displayed in a post?
- what is the difference between these phares?
- wordpress how to query wp_options table
- How to only load css for used blocks on frontend
- adding wp-cli commands to plugin: how to document to users?
- Creating an empty page programatically
- Multiple API Endpoints (wp_remote_get)
- Call to undefined function is_home() or any conditional tags
- Make dynamic string translatable
- wp_schedule_event is registered but function isn’t running
- Simple plugin don’t display content
- How to make an admin plugin menu page go full screen?
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Home page is not loading, where in other pages are displaying on the site
- Custom table / Alternative to WP_List_Table
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- WordPress with React: Saving and Using Data Collected with fetch
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- tweaking the
- external Integration with wordpress timeout error
- Problem to return more than single line captions
- Unable to show a message after plugin activation
- Use plupload to upload images and save them to custom folder and database table
- How to add conent (text) to Add New pages form of admin in WordPress
- Allow HTML in product attributes and variation for WooCommerce
- How do I modify the error code array used by “shake_error_codes” filter?
- How do I add multiple custom menu Woo-commerce my account page?