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
- Cache API Images to Prevent Hot Linking
- Multimedia upload error in my wordpress job board plugin
- WordPress admin panel not working
- Impossible to declare box-shadow with wp.customize?
- update_option() passing empty array() but still updating
- Bad request 400 using class based files
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- Gutenberg block breaks when showing new data
- Allow contributor user role to perform copy operation PHP
- How to use own css of functionality plugin?
- Get Custom taxonomy parent with wordpress REST API
- How to add .ini file type to the plugin editor to read and edit?
- Do I lose translations when I change my Text domain for my plugin on wp.org?
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What to do with the .git folder in a WordPress plugin during local development
- register_meta not showing custom post type metabox data in rest api
- Trying to rename a file upload as the hash of file content on wordpress
- Adding the image selector/uploader to an admin back page
- How to write a custom shortcode name book?
- converting a node.js project into a wp plugin
- What happens/fires when you select a block in the editor?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Is “document loaded” different on admin side than public side?
- Determine if term is Category or Tag
- Check current URL is 404 in pre_option_stylesheet filter hook
- Where to add functions and code snippets in wordpress
- Hook to execute after deleting a Custom Taxonomy
- How to re-render inspector controls?
- Override category archive page title (not the head title)
- Forbidden Error in ajax call with wordpress
- `registration_errors` filter doesn’t seem to be called
- Why User_login key doesn’t work with wp_update_user()
- How to use setAttributes outside of the edit function return
- WP plugin svn checkout 429 error “Too many requests”
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- How to grab data after wp user search is complete
- Limit get_next_post to posts from the same author
- How to Login a User inside a Plugin and Redirect to page?
- Using custom IDP with WP
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- Show list of categories that has posts with different taxonomies
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- Securing custom rest API endpoints with public access from PWA
- How do I add filter with woocommerce categories?
- ACF Field value in wordpress login message filter
- Where do I hook to have the server do something in PHP on block attribute change?
- admin-post.php form handling only working when logged in as admin
- Undefined cache functions in my custom plugin
- Some difficulties in implementing markdown editor
- By adding “?login – failed” code unable to access my dashboard
- ajax stopped working when not logged in wordpress
- Change cannonical URL after changing url with add_rewrite_rule()
- jQueryUI draggable doesn’t work in WordPress plugin
- Sanitization and validation input fields – Settings API
- WordPress shortcode with a switch
- Twenty-seventy theme remove additional CSS from head
- call funcution when clicking submit
- How to revive (or take over) a plugin?
- WP_Query not ordering correctly
- WooCommerce – Stop assigning order numbers
- Make visible page only in the trash
- How to check category name available or not
- Reading plugin settings in esnext wordpress block
- Plugin frontend page design irrespective of the theme used
- Add New Button in Admin Panel
- ajax call return 406 not acceptable for non logged users only
- Does $this context change in an AJAX callback?
- How can I pass WP_Query results to a plugin?
- Home page is not loading, where in other pages are displaying on the site
- $ is not defined [duplicate]
- How to include a page template and template part into my plugin
- Updating the_post content is only working with Twenty Twenty theme
- Hiding the WordPress login and password fields from login page
- How to store sensitive user data (passwords)
- Adding customs fields on each product on the cart
- Can’t upload image via submitting custom post from frontend