[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 11:03:23 UTC 2017


#40908: HTML Paragraph Tags are omitted in the return value of get_the_content().
-------------------------------+-----------------------
 Reporter:  digitronixweb      |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  invalid
 Keywords:                     |     Focuses:  template
-------------------------------+-----------------------
Changes (by ocean90):

 * status:  new => closed
 * focuses:  ui, administration, template => template
 * component:  Editor => Posts, Post Types
 * version:  4.7.5 =>
 * milestone:  Awaiting Review =>
 * resolution:   => invalid


Comment:

 Hello @digitronixweb, welcome to WordPress Trac!

 `get_the_content()` is not a direct replacement for `the_content()`.
 Adding paragraphs to the content is handled by the `the_content` filter
 which only exists in `the_content()`.

 To get the same content as `the_content()` you have to use `apply_filters(
 'the_content', get_the_content() )`.

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


More information about the wp-trac mailing list