Dennis Snell: Enter the mess: Shortcodes

Date:

Tonight I started working on some Shortcode processing in WordPress. This is an historically nasty problem because the Shortcode syntax and parsing is wildly dynamic.

  • Shortcode syntax is only technically recognized for shortcodes registered at the time of parsing. This means that there is not a general Shortcode grammar.
  • Whether a shortcode has “content,” meaning whether it expects a closing tag, depends on whether the closing tag exists in the post.

This is a problem that has plagued me for years and I have generally just ignored. There’s an open Core issue in Trac for changing some shortcode parsing (#50683), and I have thought a lot about it.

But I think there is more to explore, and more to gain. Maybe this goes nowhere, but keep your eyes open for it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Share post:

Subscribe

spot_imgspot_img

Popular

More like this
Related

Gutenberg Times: Gutenberg 24.0, the road to 7.2, a new default theme named Ipsum, and more—Weekend Edition 377

Howdy, Before anything else: if you maintain WordPress sites, go...

Open Channels FM: Your Website Could Use a Changelog to Fuel Creativity

A website changelog helps creators document progress, celebrate small...

Open Channels FM: Is It Time to Move On? Navigating Change and Letting Go in Fast-Paced Times

A reflection on recognizing the right time to move...

OpenStation Blog: “I can’t imagine using WordPress any other way”: the love behind OpenStation

OPENSTATION · COMMUNITY VOICES Formerly Desktop Mode, now a new...