[wp-trac] [WordPress Trac] #15694: Shortcode I/O Intolerant of "]", "<", Quotes, etc.

WordPress Trac noreply at wordpress.org
Sun Jul 26 15:46:22 UTC 2015


#15694: Shortcode I/O Intolerant of "]", "<", Quotes, etc.
------------------------------------------+-----------------------------
 Reporter:  miqrogroove                   |       Owner:  miqrogroove
     Type:  defect (bug)                  |      Status:  assigned
 Priority:  normal                        |   Milestone:  Future Release
Component:  Shortcodes                    |     Version:  3.0.1
 Severity:  major                         |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  javascript
------------------------------------------+-----------------------------
Changes (by Yapaslfeu):

 * severity:  normal => major


Comment:

 Hi,
 A new bug appears following this modification: if a shortcode is used as
 the attribute of an element present inside an enclosing shortcode, then
 it's treated before the enclosing shortcode itself!

 Example:
 {{{
 [posts type="page"]                     <— loop for each page
         <a href="[permalink]">link</a>  <— a link to the current page
 within the loop
 [/posts]
 }}}

 In the code above, the [permalink] shortcode is treated first and is
 replaced with the main page permalink, and not the permalink of the page
 being looped…

 Then, the [post] shortcode loops on the resolved content, and not on the
 original mask:
 {{{
 function ShortcodePosts ($atts, $content) {
         $query = new WP_Query ($atts);
         while ($query->have_posts ()) {
                 $query->the_post ();
                 $output .= do_shortcode ($content);     // <— no more
 shortcode to call
         }
 }
 }}}

 The solution would be to ignore all the shortcodes present in enclosing
 shortcodes, even if they are used as HTML parameters.
 (not sure to be very clear)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/15694#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list