• Hi there,

    I’ve just created a new plugin for WordPress that introduces new tag – <upsidedown></upsidedown>:

    http://wordpress.org/extend/plugins/upside-down-text/

    As you can see i’m using html/xml tag syntax, ie tags are enclosed within < and >. Now this works quite well, but there is one nuisance: when switching between visual and HTML editor, they get removed. Possibly because they are not in the list of known/valid HTML tags.
    Now I’m wondering what’s the de-facto standard when “inventing” new tags, should they be <> or [] enclosed?

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not having looked at your plugin code, I’m wondering: are you by chance using the new Shortcodes API? If not, you may want to give it a try – it would use the format [upsidedown][/upsidedown], is easy to implement, and would very likely maintain these tags as you switch your editor between Visual and HTML. It’s a pretty robust API, however it doesn’t exist before WP 2.5.

    -WC

    Thread Starter pulegium

    (@pulegium)

    Aha!! That looks so much better than what I do at the moment, which is pretty simple: using regexp I extract anything that goes between the tags and then apply modification to the text.
    This API seems to be build for that purpose, so I was in a way reinventing the wheel 🙂 But that’s ok, it’s never too late to learn as the saying goes.

    Thanks!

    Yes, it’s a pretty neat API the good WordPress folks integrated into recent versions.

    But don’t completely drop your current coding – just include it in your plugin for people using WP pre-2.5. You could have some pretty robust backward compatibility there.

    -WC

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What format to use for in-post tags?’ is closed to new replies.