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
- Plugin Form Submission Best Practice
- Plugin directory “Last Updated” not changed after initial commit?
- What is the recommended way to create plugin administration forms?
- Fatal error: Call to undefined function wp_mail()
- Does WordPress have an Browser Agent?
- How Do I Load My Action Earlier Enough?
- How to check WordPress website username and password is correct
- How to sync with plugins update after I have done manual optimizations?
- How to retrieve a value via get_option when the option_value is stored in a multi-dimensional array?
- Filter on the_content ignores shortcodes
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Check spam in custom form – akismet
- Add Admin Menu Inside Construct or Init
- get plugin directory url
- WordPress cron running twice
- How to create thumbnail of different files?
- PHP library that can merge stylesheet with inline style [closed]
- Admin-ajax.php appending a status code to ajax response
- comment_email hook doesn’t seem to work for comment editor field
- How can I add a field to make link nofollow to the WordPress Link Inspector Window?
- admin_notices not displaying in plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- Get Objects While Deleting term
- Cannot redeclare function error on the same line
- js/css updating when making a plugin
- settings_fields() doesn’t work for other roles except admin
- Subscribe to author?
- Append country to ‘pretty’ url but serve same page
- Set page template programaticlly in plugin
- Adding a brand column to WooCommerce Products
- How to use output buffering in WordPress hooked functions?
- Plugin menu addition in multisite
- Mixing and Matching – Custom templates in a WordPress plugin
- Open Graph Object Debugger & url parameters – Page Not Found result
- How to get Metabox custom field to show checked if value is updated using post meta query?
- wp_schedule_event seems to be being added twice
- How to Move the Comments Bubble to the Right Side of the Toolbar
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- What happens when two or more plugins use the same hook?
- Can’t find where to modify attrbitutes
- How to pull user/author profile data in a plugin?
- Adding columns to core tables
- Add Password Generator on password protected page
- WordPress pages are not published due to External database connection with WPDB class
- How to optimize multiple insert into wordpress database
- Injecting HTML on (arbitrary) admin pages
- Custom Stylesheet instead of Inline CSS for WordPress Customizer API Overrides
- How to add custom options for plugin into the add post screen – like yoast seo
- Information on plugin adding text when a post, page, or other such is displayed
- How to relate the Category to user?
- Plugin’s total number of users
- Get coordinates of selected area to use in image maps [closed]
- Setting post_id for single.php based on URL without a redirect
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Conditionally check if page is using template from plugin directory
- plugin css is not being applied to the page
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Is there any way to get post meta from publish_post hook?
- How to save multiple values in custom post type from front end to back end
- How to create plugin settings page for each admin user?
- Using JavaScript in WordPress page to call for server data using AJAX
- Headers already sent on custom plugin (Export function)
- Insert Data into Database
- login_message filter not working
- Displaying Custom Post Meta
- wp_enqueue_style don’t register all google fonts
- API WordPress is Limited? Return False
- How to return a blank page
- Array/List Edit in Backend
- How to Modify My Plugin’s Admin Settings so that the Plugin can be Added to a Specific Page?
- To remove rendering of menus and header, plugin or theme?
- Wrapping shortcodes in another shortcode
- How to display custom taxonomy and terms using/creating plugin template
- Display Data’s metabox in page
- How to add ‘use_desc_for_title = 0’ to all wp_list_categories calls?
- Can I log the searches that are returning 404 in the DB?
- My activator class isn’t running the code inside