WordPress.org

Forums

Audio Player
Shortcode shows up as "undefined" in Visual Edit Mode in WP 3.9 (7 posts)

  1. Heyitsrick
    Member
    Posted 1 year ago #

    This just started happening after the WP 3.9 update. All of our WP Audio Player shortcodes now show up as "undefined" (without the quotes) when editing a post in Visual Edit Mode in the new WP 3.9.

    I'm guessing this has to do with the TinyMCE (what powers Visual Mode editing in WP) version update to 4.x from 3.x in older WP versions.

    Anyone else seeing this, and any fixes?

    When switching to "Text" Editing mode, the [audio: xxxx ] shortcodes show up fine and can be edited. But some of our editors like using Visual mode, and this means toggling back and forth between modes to edit the shortcode if need be.

    https://wordpress.org/plugins/audio-player/

  2. montrey
    Member
    Posted 1 year ago #

    Did you find a solution? We are having the same issue!

  3. Heyitsrick
    Member
    Posted 1 year ago #

    We have a suspicion (just a theory) that "audio:" is now a reserved shortcode in WP 3.9.

    As an experiment, I tried capitalizing the "A" so my shortcodes started with [Audio: instead of [audio: .

    Guess what? They showed up fine in visual mode, AND they also worked in that the actual audio player displayed normally.

    You can try that yourself and let me know if it works for you. If you really needed to edit older posts for some reason, you could probably do a global search and replace to capitalize the A (assuming capitalizing it works on your end). But it's most helpful when creating new posts, obviously. Old posts are already in play unless they need to be edited, and, of course, switching to text mode is also a clunky workaround.

  4. electblake
    Member
    Posted 1 year ago #

    The issue is that the update added native audio support.

    You can solve it by embedded using format:
    [audio src="http://www.dubstep.info/virus.mp3"]

    Read more at:

    http://en.support.wordpress.com/audio
    http://codex.wordpress.org/Audio_Shortcode

  5. Heyitsrick
    Member
    Posted 1 year ago #

    @electblake - Appreciate the links. However, your method doesn't work for me. While I can see the link itself in visual mode after editing/composing the post, I don't see the brackets, or the audio keyword, etc., if I go back into visual editing mode. Plus, the mp3 link you posted to dubstep.info is dead, anyway, lol.

    Remember, this post is about people who are still using the WP Audio Player plugin that uses an audio shortcode. You're quoting how to embed an html5 native audio player in WP. While I know that's an option, we (for our own reasons at present) are using the older WP Audio Plugin and the latest WP update broke the way the WP plugin shortcode displays when in visual mode (the player itself still works fine).

    Here's a sample working mp3 link that anyone can test:

    http://www.tonycuffe.com/mp3/cairnomount.mp3

    Using your method:

    [audio src="http://www.tonycuffe.com/mp3/cairnomount.mp3"] doesn't work for a couple of reasons. First, after editing you only see the link itself when in visual mode. So, you don't see [audio src=" "]

    More importantly, while the old WP audio player does display when previewing the post or looking at the published post using your syntax, it always returns "File Not Found" for the audio cut.

    My workaround is to just capitalize the "a" in "audio", so it would be seen like this:

    [Audio: http://www.tonycuffe.com/mp3/cairnomount.mp3]

    Using this method, you see the entire shortcode in either visual or text mode, and the WP audio player displays and finds the track fine.

    Here's how the test mp3 syntax above would look with additional WP Audio Player (the old plugin we're using) parameters, such as title and artist info, as well as counting UP the time, vs. counting down:

    [Audio: http://www.tonycuffe.com/mp3/cairnomount.mp3|titles=Test MP3|artists=Tony Cuffe|remaining=no]

  6. electblake
    Member
    Posted 1 year ago #

    @Heyitsrick, fair enough. Wasn't really posting as full solution but more about what research I had dug up. Once I learned native 3.9+ [audio] support, I adapted my own system - good luck to others.

    and virus.mp3 was never a real link.

  7. Heyitsrick
    Member
    Posted 1 year ago #

    Hey, no problem. Thanks again for the documentation links. And funny about the virus.mp3 example. Should have known that. We're going to be moving away from the old WP Audio plugin ourselves, but need to get a couple of things in place first. Thanks for chiming in.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic