[wp-trac] [WordPress Trac] #26877: Allow get_post() to accept a custom post object instead of only WP_Post

WordPress Trac noreply at wordpress.org
Mon Feb 17 20:06:47 UTC 2014


#26877: Allow get_post() to accept a custom post object instead of only WP_Post
------------------------------------+-----------------------------
 Reporter:  MikeSchinkel            |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Future Release
Component:  Posts, Post Types       |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-----------------------------
Changes (by danielbachhuber):

 * milestone:  Awaiting Review => Future Release


Comment:

 Just ran into a very similar use-case. #24672 looks related to me. I
 suspect we need to:

 * Finish classes for the other WordPress objects.
 * Remove the `final` from `WP_Post` et all so they can be properly
 subclassed.
 * Allow `WP_Query` and similar to return subclass instances.

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


More information about the wp-trac mailing list