[wp-trac] [WordPress Trac] #34722: Open P Tag in shortcode related to h tag

WordPress Trac noreply at wordpress.org
Sun Nov 29 07:44:56 UTC 2015


#34722: Open P Tag in shortcode related to h tag
--------------------------+------------------------------
 Reporter:  BackuPs       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------

Comment (by BackuPs):

 Hi

 Thank you for the feedback and extra info as that is really appreciated.
 The example given was simplified to narrow down the issue and pin it to
 the shortcode processor within the wordpress code.

 Our real shortcode is much more complicated and has more shortcodes within
 the shortcode even nested ones of the same type.

 I think i might be better of for now leaving the p tag open. However it
 would be a great plus if the wordpress team fixes this ones and for all.
 Especially given the fact how long this 'bug' is already existing in the
 wp core files.

 I will try your solution though on the more simple shortcodes we are using
 and also apply the do_shortcode to the content first in order to see what
 happens when shortcodes have shortcodes within the content.

 {{{#!php
 <?php
 function theme_shortcode_div($atts, $content = null, $code) {
         $content = str_replace( '<p></p>', '', wpautop(
 do_shortcode($content)) );
         return '<div class="theme-div">' . $content .'</div>';
 }

 add_shortcode('theme_div', 'theme_shortcode_div');
 }}}


 I can imagine that that will cause many issues though. The open p-tag
 should not have been there at all in the first place. But that we already
 agreed upon.

 Have a nice weekend ! & Thanks again for the feedback

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


More information about the wp-trac mailing list