Sounds like a custom TinyMCE button would be the ideal candidate for the job.
WordPress has an excellent write-up in the codex on how to create one; you’d essentially add a button to the TinyMCE toolbar with your own callback, which could trigger a modal pop-up to choose the audio file & insert the shortcode automatically.
Equally, you could hook into the output of media items once they’ve been uploaded, and display a link that would inject the shortcode for that item into the post (if uploaded within the Thickbox pop-up) – akin to how featured thumbnails work.
Check out get_media_item()
and get_attachment_fields_to_edit()
in wp-admin/includes/media.php
for available hooks and filters.
Related Posts:
- Adding custom meta boxes to specified custom post type
- Updating post meta for custom post types
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Plugin “Meta Box”: Implementing meta boxes in custom post type
- RW Meta Box ,Problem setting post title
- Correct way to make meta box with more than one meta field secure
- get_post_type on post.php
- All of my custom posttypes are 404’ing
- Metabox not show in categories custom post type cmb2
- Date format – Meta Box plugin
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- Add an action based on custom post meta field
- Displaying image from a repeatable group
- How to add jquery to my custom post type wp plugin
- How can i do custom author list?
- WordPress User Frontend Editing Custom Fields
- Should i delete the posts created by a plugin on uninstall?
- Advanced Custom Fields
- Allow users mark posts as “complete”?
- Where to hook my plugin’s action
- Is there a way to order posts and custom post types as one group?
- Is there a filter for get_post_custom()?
- How does WP handle multiple matching rewrite rules?
- how do i remove posts from a WP_Query so the pagination is right?
- Saving Custom Post types and fields to a custom table
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Building a store locator with google maps
- Populate Custom Fields in a Custom Post Type?
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Accessing post’s meta data based on user’s click of a post
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Not able to complete meta box save function and sanitization/validation
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- Plugin custom post type – Internal server Error
- Exclude post by custom meta with pre_get_posts
- How can I create a custom shortcode that will return a custom post type by ID?
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]
- Is it possible to create Custom Post plug-in?
- get_post_type() and WP_QUERY issue
- List taxonomy terms for post as checkboxes
- What is generating my meta og:description?
- more types plugin – display all post of post type on page
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Save / Show multi line text in metabox
- How to make a proper custom post type link
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- Matching Chapters to a Custom posts [closed]
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- Custom post type – no layout section of Document tab, and no author choice
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- A better way to add a meta box to custom post types
- ‘No Results Found’ on single post for custom post type
- Keep a post copy when this one is updated – issue
- Making a Template for a CPT created by a plugin
- PHP basics help in WP context – remove a class/function?
- how to add a button next to the wordpress view button?
- get current date + 90 days and checking every day
- auto populate list of questions if user select a category xyz
- How to remove plugin metaboxes from edit.php
- How can I make my metabox appear?
- How to inform the user that the save was not successful?
- How can I change the meta_key for a particular piece of information?
- WordPress Post Visibility Options for Frontend
- Show Custom Post Type meta boxes only on Page Edit
- How to Add multiple instance of meta box to custom post type
- Mq translate plugin custom post type issue
- Show meta box only when post is being published first time
- Retrieving Meta from Image Attachment
- Bulk update all posts from plugin settings screen
- “Custom Post Type Permalinks” plugin URL strcuture
- Unable to delete custom post types, confusion around capabilities
- WordPress metaboxes – textfield suggestion automatically populated
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Adding CSS to custom post type admin page causes error
- Custom fields for custom post type
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- Why are my queries interfering with the global post variable?
- Meta Data for Custom Post Type not saving
- What is the best way for showing a grid of customer logos?
- Custom Post Type Fields
- How to delete all trashed item in one-go
- Meta box losing its value when scheduled post is published
- How to insert multiple postmeta values with one query?
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- Custom setup of wordpress comments that are displayed
- publish_post action doesn’t work
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- Finding the screen id of a page generated with add_menu_page
- WordPress custom taxonomy not showing
- Mass SQL WordPress Meta Key deletion