[wp-trac] [WordPress Trac] #40908: HTML Paragraph Tags are omitted in the return value of get_the_content().
WordPress Trac
noreply at wordpress.org
Fri Jun 2 10:55:37 UTC 2017
#40908: HTML Paragraph Tags are omitted in the return value of get_the_content().
------------------------------------------+-----------------------------
Reporter: digitronixweb | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 4.7.5
Severity: normal | Keywords:
Focuses: ui, administration, template |
------------------------------------------+-----------------------------
Hello,
I noticed a minor bug regarding the default Wordpress Post & Page content
field.
When getting the value of the default Wordpress content WYSIWYG field
using the following snippet:
{{{#!php
<?php
if(have_posts()) {
while(have_posts()) {
the_post();
the_content();
}
}
}}}
The correct HTML formatting is output as expected.
If instead I use the following:
{{{#!php
<?php
if(have_posts()) {
while(have_posts()) {
the_post();
echo get_the_content();
}
}
}}}
HTML tags persist in the resulting value, however, paragraph tags are
seemingly omitted from the value return from the call to
`get_the_content`.
Thanks!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40908>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list