Title: Modification for valid shortcode syntax
Last modified: August 19, 2016

---

# Modification for valid shortcode syntax

 *  [ssmathias](https://wordpress.org/support/users/ssmathias/)
 * (@ssmathias)
 * [15 years ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/)
 * I’ve locally revised the audio-player.php file to allow for valid shortcode syntax,
   as the current form ([audio:*]) is not recognized as a registered shortcode.
 * At this time I do not believe that I have authority to revise this plugin officially,
   so I am including the added code below. Please note that this is backward compatible,
   so use of the old form does not break. The syntax, however, is slightly different.
 * First, the code. The next line should be added to the constructor:
    `add_shortcode('
   audio', array(&$this, "shortcodeHandler"));`
 * Following that, this function should be added to the class:
    [Code](http://pastebin.com/x8aUh4nV)
 * The use for this shortcode is slightly different as well. An example is included
   below:
 * `[audio href="/my_sound.mp3,/my_other_sound.mp3" titles="My Sound 1, My Sound
   2" authors="Me, Me" loop="yes"]`
 * I’d like this code to formally be added in an update, but in the mean time it
   should work for anyone having issues with compatibility with a CMS.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Dan Griffiths](https://wordpress.org/support/users/ghost1227/)
 * (@ghost1227)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/#post-2053759)
 * I haven’t been able to get this to work…
 *  Thread Starter [ssmathias](https://wordpress.org/support/users/ssmathias/)
 * (@ssmathias)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/#post-2053760)
 * Ghost, did you add the code as linked, as well as a line defining the shortcode(
   included as the first piece of code in my post)? The modifications I’ve written
   are not, to my knowledge, included in the plugin’s codebase, and must be added
   manually.
 *  [Dan Griffiths](https://wordpress.org/support/users/ghost1227/)
 * (@ghost1227)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/#post-2053761)
 * I did, after editing the file it simply displayed the shortcode.
 *  Thread Starter [ssmathias](https://wordpress.org/support/users/ssmathias/)
 * (@ssmathias)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/#post-2053762)
 * Interesting. It sounds like the shortcode handler is not being executed. You 
   could try putting some print statements in that function to see if the code is
   being executed. If all else fails, you are welcome to send me a copy of your 
   code as modified to steve at crowdfavorite dot com and I could take a look at
   it after I finish with work for the day.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Modification for valid shortcode syntax’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/audio-player.svg)
 * [Audio Player](https://wordpress.org/plugins/audio-player/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/audio-player/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/audio-player/)
 * [Active Topics](https://wordpress.org/support/plugin/audio-player/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/audio-player/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/audio-player/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [ssmathias](https://wordpress.org/support/users/ssmathias/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/modification-for-valid-shortcode-syntax/#post-2053762)
 * Status: not resolved