{"id":21,"date":"2026-09-26T03:43:45","date_gmt":"2026-09-26T02:43:45","guid":{"rendered":"https:\/\/sripuwath.com\/index.php\/2026\/09\/26\/dennis-snell-enter-the-mess-shortcodes\/"},"modified":"2026-09-26T03:43:45","modified_gmt":"2026-09-26T02:43:45","slug":"dennis-snell-enter-the-mess-shortcodes","status":"publish","type":"post","link":"https:\/\/sripuwath.com\/index.php\/2026\/09\/26\/dennis-snell-enter-the-mess-shortcodes\/","title":{"rendered":"Dennis Snell: Enter the mess: Shortcodes"},"content":{"rendered":"<p class=\"wp-block-paragraph\">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.<\/p>\n<ul class=\"wp-block-list\">\n<li>Shortcode syntax is only technically recognized for shortcodes registered at the time of parsing. This means that there is not a general Shortcode grammar.<\/li>\n<li>Whether a shortcode has \u201ccontent,\u201d meaning whether it expects a closing tag, depends on whether the closing tag <em>exists<\/em> in the post.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">This is a problem that has plagued me for years and I have generally just ignored. There\u2019s an open Core issue in Trac for changing some shortcode parsing (<a href=\"https:\/\/core.trac.wordpress.org\/ticket\/50683\">#50683<\/a>), and I have thought a lot about it.<\/p>\n<p class=\"wp-block-paragraph\">But I think there is more to explore, and more to gain. Maybe this goes nowhere, but keep your eyes open for it.<\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sripuwath.com\/index.php\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}