[wp-trac] [WordPress Trac] #34722: Open P Tag in shortcode related to h tag
WordPress Trac
noreply at wordpress.org
Wed Nov 18 10:23:44 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: | Focuses:
--------------------------+------------------------------
Comment (by BackuPs):
More notes and information to add to narrow it down.
1) If i add the pure htm code with a div around it manually without using
the shortcode it also ok and wordpress formattes correctly the p-tag by
closing it.
{{{
<div class="theme-div"><h3>Integer in ex vel urna tempor ultrices.</h3>
Morbi vehicula a orci nec dignissim.</div>
}}}
Which leads me to believe this is shortcode related and not tinymce. But i
am not sure about that.
2) There is a mistake in above html provided. The gets worse should be
{{{
[theme_div]<h3>Integer in ex vel urna tempor ultrices.</h3>Integer in ex
vel urna tempor ultrices.</h3><p> Morbi vehicula a orci nec
dignissim.</p>[/theme_div]
}}}
3) Of course our shortcode does more then above. I just narrowed it down
to a basic one.
The $content=$content; is usesless in our provided code. But simply adding
do_shortcode($content); does not change the result. So the code was
provided basic. That line could have been removed from the provide code or
f.e. changed to this.
{{{#!php
<?php
function theme_shortcode_div($atts, $content = null, $code) {
$content = do_shortcode($content);
return '<div class="theme-div">' . $content .'</div>';
}
add_shortcode('theme_div', 'theme_shortcode_div');
}}}
I hope this narrows it down.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34722#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list