[wp-trac] [WordPress Trac] #12955: Add get_post filter
WordPress Trac
noreply at wordpress.org
Sat Nov 19 01:25:04 UTC 2016
#12955: Add get_post filter
------------------------------------+-----------------------------
Reporter: JohnLamansky | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+-----------------------------
Comment (by MikeSchinkel):
Replying to [comment:52 danieliser]:
> TBH This filter needs 2 things considered in my oppionon.
>
> 1. The WP_Post class needs to have Final removed so it can be extended
properly.
Do that, and this filter is much less needed. For me this ticket is a
workaround to `WP_Post` being `final`.
> @MikeSchinkel - here is a full example based on the extendable Post
class I linked above and how we are using it in a themeable plugin.
And as I mentioned to @flixos90, that is fine until you''(r client)''
wants ''(you)'' to use a plugin that expects there to be a global `$post`
and within a hook that plugin calls a function that calls `get_post()` to
sanitize/normalize said global `$post`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12955#comment:54>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list