You may need to update your shortcode function to generate the audio player using proper HTML markup instead of returning the raw shortcode text. Here’s an example:
function myshortcode_shortcode() {
$audio_url="path/file.mp3";
$audio_markup = '<audio controls><source src="' . esc_url($audio_url) . '" type="audio/mp3"></audio>';
return $audio_markup;
}
Related Posts:
- Replace audio/video enclosure with player?
- Enhance Media Manager for Gallery
- 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)
- Change Media Uploader default directory
- How to extend LINK TO functionality in ATTACHMENT DISPLAY SETTINGS
- Mediaelement.js feature doesn’t work
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- WordPress Media mime type filter problem 4.0
- What filter should I use to insert a button inside on Media>Add New
- How to replicate Media Library “Add New” on Plugin Settings Page
- Create a new post using rest api and save featured image using an external image url
- Capture mediaelement events
- PowerPress mobile media player
- 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
- Default media uploader is not showing in wordpress website
- Dynamic banner for use on external sites
- Thumbnails for media Library images
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- upload image to wordpress media library failed for custom post type
- Is there any plugin development framework
- How do I add CSS options to my plugin without using inline styles?
- Handling results from data hooked into admin_post
- How do I create links at the top of WP_List_table?
- Why Does get_posts() Return an Empty Set?
- Get list of available wordpress actions
- Where to enqueue stylesheets for plugin?
- How can i list current author’s categories?
- stray elements
- Rest Api How to get results of child categories with one api call
- How to store accumulate multiple option values in a single array using Options_API
- Add Post and Comments menu no longer visible
- WordPress password reset – why post rp_key?
- How to modify the new WordPress 4.5 link inline toolbar
- Proper way to hook wp_get_attachment_url
- How to install WordPress Popular Posts plugin twice?
- Get the link text
- Multisite plugin development and wp_enqueue_script
- Is Dreamweaver CS5 a serious choice for theme/plugin development?
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- How do I obtain a list of categories assigned to the current post?
- How to set “Site Address (URL)” programmatically on WP multisite?
- Modify hard-coded conditionals for roles to custom roles
- Reset plugins version cache | pre_set_site_transient_update_plugins
- Add column and post filter for a custom post type field on the edit.php page
- Does wp_login only trigger before an user signs in into the admin panel?
- How to access noticeOperations from withNotices
- How to fetch all images from a WordPress draft using PHP?
- parse content from wikipedia article replacing search term with the title of article
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- Thickbox doesn’t respect dimensions when used in admin [duplicate]
- Wrap text around shortcode
- Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins
- Declare plugin dependency [duplicate]
- Plugin does not add action
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Jquery was not found on this server
- Is there an admin hook that will let me read GET variable before it’s too late to set the header Location
- WordPress plugin development OOP style
- How to create a digital product download link that can’t be used twice?
- How to create ShortCode
- shortcode tags not working in do_shortcode
- Working of foreach loop with array
- How to change a field in database through a submit button or Checkbox? [closed]
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- $wpdb->update Issue
- wp_insert_post generated mixed permalinks
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- Import images remotly run through timeout error
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Load specific page when a custom URL is hit
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- Trying to rename a file upload as the hash of file content on wordpress
- Getting products information, in woocommerce based on products ID
- Fatal error: Uncaught Error: Using $this when not in object context
- How can I measure CPU and RAM used by my theme or plugin
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- do I need to sanitize a shortcode’s function input?
- Modify search form with plugin
- Organising and completing posts (mark as read and hide)
- How to display properly exception or echo string after posting in plugin?
- When using an options array the Settings API isn’t creating the database record
- the correct way to use options from settings page [closed]
- On one of my sites a file is shown as 404 but the file IS there
- I want to add post meta for picture thum during submit for revision
- How to synchronize an e-commerce site and a pharmacy management software?
- woocommerce features to add product along with link
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- wp_head is not fired from the hook I have used in my plugin
- Insert text programmatically in WordPress Gutenberg Editor
- Can we write custom DOM manipulation inside edit.js file while developing custom Gutenberg block?
- User set default settings for a Block in Site Editor
- ‘global’ not working when passing variable from plugin file to template
- get_template_parts() usage
- `post_updated_messages` filter