[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 15:58:10 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 turbodb):

 Thanks for the suggestion @siliconforks.

 Using the {{{wp_kses_allowed_html}}} filter might work, but in your
 example you've limited it to the {{{'pre_comment_content'}}}, which as I
 mentioned in the original bug, already works correctly using the hook of
 the same name.

 Without that context limitation, using {{{wp_kses_allowed_html}}} has the
 same issue I've raised as using the {{{init}}} hook - namely that it's a
 much larger scope and opens up a much larger area than the targetted use
 of {{{<img>}}} that I'm aiming to allow here, which is ''only'' in
 comments.

 By using {{{wp_kses_allowed_html}}} - unless there's a {{{$context}}} for
 editing comments, in which case, I should be able to use the specific hook
 for that {{{$context}}} - I would be allowing {{{<img>}}} everywhere that
 HTML is filtered,

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


More information about the wp-trac mailing list