[wp-trac] [WordPress Trac] #12267: Upgrade loop objects to provide identical presentational interfaces

WordPress Trac noreply at wordpress.org
Thu Mar 17 08:34:56 UTC 2016


#12267: Upgrade loop objects to provide identical presentational interfaces
-------------------------+------------------------------
 Reporter:  andy         |       Owner:
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by swissspidy):

 Yeah, the naming should probably be as generic as possible. But that's a
 detail.

 Besides that, I'd probably remove `has_excerpt()` and
 `has_post_thumbnail()` methods. The respective functions can just do
 something like `empty( $post->get_excerpt() )`.

 https://github.com/humanmade/WordPress-Objects/blob/master/wordpress-
 objects.post.php could serve as an inspiration for what is possible. I
 particularly like simple methods like `get_title ()`, `get_parent()`,
 `get_status()`, and the `*_meta()` ones.

 The usefulness of such an enhancement has already been discussed a couple
 of times and we definitely do not need to move everything into `WP_Post`,
 only where it makes sense.

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


More information about the wp-trac mailing list