[wp-trac] [WordPress Trac] #62644: Editing comments as an admin, in the Admin UI, filters the HTML elements of the comment as though the edit was done by the original author.
WordPress Trac
noreply at wordpress.org
Thu Dec 5 18:51:09 UTC 2024
#62644: Editing comments as an admin, in the Admin UI, filters the HTML elements of
the comment as though the edit was done by the original author.
--------------------------+------------------------------
Reporter: turbodb | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 6.7.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by siliconforks):
The $context value could be basically anything (including custom values
used by plugins, etc.). For comments I think you only need to worry about
the `pre_comment_content` context as I believe this is used for both
posting comments on the front-end of the site and editing comments in the
admin section.
This is triggered by the `pre_comment_content` filter
[https://github.com/WordPress/wordpress-develop/blob/6.7.1/src/wp-
includes/comment.php#L2143 here], which will call the function
`wp_filter_kses`, which sets the context to the value of
`current_filter()` [https://github.com/WordPress/wordpress-
develop/blob/6.7.1/src/wp-includes/kses.php#L2157 here] - hence the
context is named the same as the filter, `pre_comment_content`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62644#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list