[wp-hackers] wordpress shortcodes

Leho Kraav leho at kraav.com
Tue Feb 4 04:07:00 UTC 2014


On 04.02.2014 04:06, Otto wrote:
> Actually, your caption code doesn't work at all for me. Inserting blank
> lines causes the caption to not appear.
>
> The extra blank lines aren't accepted inside shortcodes because the regex
> being used for them doesn't like it. If you want to try to sort out why,
> then you can examine the regex in the get_shortcode_regex() function.
>
> But there is no functional difference between the caption shortcode and the
> audio shortcode, because shortcode functions do not parse their own text,
> generally. The core parses the shortcode including the attributes, then
> calls the appropriate function to handle it. Shortcode functions never see
> those blank lines, they only get an array of attributes.

Not sure why Otto didn't point you to 
http://core.trac.wordpress.org/ticket/14050 but go take a look there, 
too. I put in some work on these problems, not sure whether your 
multi-line attributes use case is something I'm covering so far though.


More information about the wp-hackers mailing list