[wp-trac] [WordPress Trac] #15515: content_save_pre et al don't supply context
WordPress Trac
noreply at wordpress.org
Wed May 5 19:44:31 UTC 2021
#15515: content_save_pre et al don't supply context
---------------------------------------------------+----------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Posts, Post Types | Version: 2.3
Severity: normal | Resolution: wontfix
Keywords: has-patch needs-refresh bulk-reopened | Focuses:
---------------------------------------------------+----------------------
Comment (by swissspidy):
Unfortunately this workaround of accessing the global `$post` doesn't seem
to work. It's never set, neither are any other useful globals.
I want to filter `wp_kses_allowed_html` only for a specific post type. My
current workaround is to use the `wp_insert_post_data` filter, which
provides access to both the sanitized and unsanitized post data. So in
this filter I just run the unsanitized data through KSES, but now with my
filters applied.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/15515#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list