[wp-trac] [WordPress Trac] #12955: Add get_post filter

WordPress Trac noreply at wordpress.org
Wed Apr 25 04:50:37 UTC 2018


#12955: Add get_post filter
------------------------------------------------+--------------------------
 Reporter:  JohnLamansky                        |       Owner:  (none)
     Type:  feature request                     |      Status:  new
 Priority:  normal                              |   Milestone:  Future
                                                |  Release
Component:  Posts, Post Types                   |     Version:
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch dev-feedback 2nd-opinion  |     Focuses:
------------------------------------------------+--------------------------

Comment (by danieliser):

 @Mte90 - In all honesty that is a terrible idea. To clarify I understand
 what you are saying, and I love the feeling of starting fresh, but it
 feels very much like every other issue that gets a lot of discussion and
 feedback that simply doesn't fit what the final solution ends up being.
 Once you close this and move to the other, as you say nobody will troll
 the very viable & valid feedback collected here, it essentially gets
 dismissed as irrelevant and lost in a black hole forever.Just my 2 cents.

 I say the proposed changes to the other solution look way more difficult
 to set up. Are we proposing to set up a custom model we would have to
 filter 6 different methods? That completely defeats the purpose of OOP and
 extending the base model from the limited context available in that
 ticket. Feels like a workaround rather than a real solution.

 Final does need to be removed, but the filter part makes no sense once you
 remove final.

 The only real issues are this:
 - You need to be able to extend core model efficiently (remove final).
 - There needs to be a centralized way to overload the object initialized,
 ensuring its an instance of WP_Post, and allowing it to be cached
 correctly.

 Beyond that WP_Post can then further be extended with the knowledge that
 people are going to use it for various things including CRUD, so adding
 standardized helpers in the future would be my next step, such as
 $post->get_meta('key', $single, $default)

 Just my 2 cents, but the other ticket being discussed is only half the
 problem. If anything we should be looking to merge them into one new
 ticket that solves both issues.

 I would be happy to join a small conversation on the matter via slack and
 provide some samples or even contribute some patches if I think they will
 pass the communities much-desired parameters.

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


More information about the wp-trac mailing list