[wp-trac] [WordPress Trac] #24330: When adding the post_formats_compat the_content filter a post ID argument should be included

WordPress Trac noreply at wordpress.org
Mon May 13 19:58:12 UTC 2013


#24330: When adding the post_formats_compat the_content filter a post ID argument
should be included
--------------------------+--------------------
 Reporter:  gcorne        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.6
Component:  Post Formats  |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by markjaquith):

 WordPress core has, for years, relied on the convention that `the_content`
 filters are meant to be run inside a loop context with a valid global
 `$post` object. Multiple WordPress core functions already make that
 assumption, like `gallery_shortcode()` and `prepend_attachment()`, as well
 as all our embed handlers (which do caching by post ID). Any third party
 shortcode that touches post meta will be in the same boat, and won't work
 if `$post` isn't as expected.

 It's not very clean, but it '''is''' expected and well-established
 behavior.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24330#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list