You are missing multiple single quotes around $a[url]
, so after src="https://wordpress.stackexchange.com/questions/350229/
there should be a” and after $a[url]
there should be another single quote, and you also need to quote the array key, so the whole return line should be
return '<audio class="listen" preload="none" data-size="250" src="' . $a['url'] . '"></audio></div></div>';
Related Posts:
- How do I use Shortcodes inside of HTML tags?
- Retrieve multiple values passed to a single attribute in a shortcode
- WordPress Shortcode and Dynamic CSS
- Display a text message if the shortcode is not found?
- How to use a frontend URL with a Plugin
- Loading page template into shortcode
- My shortcode is showing up twice
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How to display a value from a radio button in the options menu in wordpress
- Making Quote Plugin more efficient
- Placing raw HTML inside a WordPress shortcode
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- Append HTML Using Shortcode
- Plugin CSS not enqueing
- How create a Shortcode with hover and complex options
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Using ob_start and ob_get_clean with wordpress shortcode
- WordPress shortcode returns the data before
- How to Schedule Cronjobs for start of every month and year
- Handling PHP/HTML inside the output of a shortcode function
- Action Hook Inside WordPress Plugin Shortcode
- Calling PHP Titles inside Javascript Markup
- What is the difference between Null vs Empty (Zero Length) string?
- Shortcode displaying at the top of the page [duplicate]
- How to Create custom block for displaying information in content section which act like shortcode
- Shortcode in Shortcode/HTML Graphics and Pictures
- couldnt show short code atts in category
- Drop down question
- Display a custom name when the user has no name settle in his account
- How do I disable cache for a certain page?
- How can I edit the final HTML structure of the whole web page
- overwrite wordpress gallery with custom gallery shortcode
- Problem with my Login Plugin
- How can I create a shortcode from an html and php code written together
- Shortcode Works for Logged in Users but Not Working for Guest
- Show contact 7 form in popup
- using a shortcode in a hyperlink
- Is there a better way to output HTML as a shortcode?
- WP Custom tables query
- Custom plugin with shortcode not working
- Return HTML Template Page with PHP Function
- Multiple pages on one with different HTML
- Add custom HTML to posts page
- How to return multiples lines in a shortcode?
- How to return a foreach inside a shortcode
- Page Reloads Before AJAX Request Finishes
- How to only show page id as body class?
- Insert array data on plugin activation
- Adding Default Settings to Theme My Login plugin
- filter default query to show just selected level of child pages in wordpress
- How to make my custom widget appear within WordPress widgets? Plugin development
- Input data from email form not going to JSON file
- do_shortcode with custom field
- Remove echo from shortcode
- Show latest posts in a plain HTML website custom widget [closed]
- Hide HTML element (by class or ID) with PHP
- How to remove coupon dropdown feature
- Shortcode to find and replace URL
- How to put a form with php code into a variable or shortcode?
- Usage of call back function of add_meta_box()
- Add html link in functions.php files of the theme
- PHP contact form not redirecting [closed]
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- PHP error with a shortcode: “no suitable wrapper” for file_get_contents
- Need help removing […] after excerpt
- How can I get plugin meta data without knowing the plugin folder?
- post content and shortcode content displaying out of order
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- Background image no longer fits to screen now that project is in php files
- Trying to call dynamic content into a 3rd party shortcode
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- How to search order using database frontend short code WordPress
- How to add a shortcode which runs a .php file for the current post
- Block error message in foreach loop when looping through ACF field
- PHP multiple forms, same page, isset($_POST[]) not working?
- shortcodes, custom php and their errors
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- Show subcategory name selected in specific category woocoommerce
- Need help with format of nested array in MySQL
- How to add delete, approve, spam Links to Comments
- Setting at job with shortcode not working
- Run code before WordPress loads and insert data into WP if need be
- PHP: Why does my code work in index.php but not a widget?
- how to manipulate HTML parameters using PHP conditions
- How to edit homepage in WordPress?
- Shortcode to include PHP file, pass various parameters to include?
- I’m not able to get access $wpdb in my php file in wordpress
- Import users and custom user meta from csv
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- Remove post image caption from post_excerpt();
- Prevent users from display default wordpress login form
- Create custom table for wordpress custom registration flow
- Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?
- How call WordPress shortcode inside function file
- WordPress wp_set_object_terms does not assign product to custom taxonomy