[wp-trac] [WordPress Trac] #30292: Stop get_post() overwriting non-WP_Post objects passed as first parameter

WordPress Trac noreply at wordpress.org
Tue Oct 13 14:58:48 UTC 2015


#30292: Stop get_post() overwriting non-WP_Post objects passed as first parameter
------------------------------------+------------------------------
 Reporter:  MikeSchinkel            |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Posts, Post Types       |     Version:  3.5
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------------------

Comment (by sc0ttkclark):

 For starters to help move this patch forward, it needs a refresh and the
 apply filters needs to be on it's own line outside of the if() logic and
 using null instead of false. Then you'll want to explicitly check if null
 !== and possibly override the variable here from $_post to be $override or
 similar. I could also be mistaken but I think hook docs for filters need a
 `@return` too, but maybe not.

 I'm +1 on this patch once those things are done because of what it can
 provide for people.

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


More information about the wp-trac mailing list