[wp-trac] [WordPress Trac] #32319: the_content filter should provide reference to post

WordPress Trac noreply at wordpress.org
Sat May 9 17:03:15 UTC 2015


#32319: the_content filter should provide reference to post
-------------------------------+----------------------
 Reporter:  shramee            |       Owner:
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.2.2
 Severity:  normal             |  Resolution:  wontfix
 Keywords:                     |     Focuses:
-------------------------------+----------------------

Comment (by DrewAPicture):

 I should clarify that while this hook doesn't always get evaluated inside
 the loop (via `the_content()`, that was the original intent. In recent
 times since this hook was introduced in the very beginning of WordPress,
 it has been used for other purposes to simply format passed content. If
 you're using it in the loop, the `$post` global should be accessible as
 outlined above.

 And as @SergeyBiryukov aptly pointed out, it's not really feasible to pass
 that value to every instance of the hook because of the variety of
 situations it's leveraged in today.

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


More information about the wp-trac mailing list