[wp-trac] [WordPress Trac] #61727: Add `$context` parameter to `get_edit_comment_link()` to get the URL without HTML entities
WordPress Trac
noreply at wordpress.org
Mon Jul 22 22:51:33 UTC 2024
#61727: Add `$context` parameter to `get_edit_comment_link()` to get the URL
without HTML entities
-------------------------+-------------------------------------------------
Reporter: flixos90 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Comments | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests good-
Focuses: template | first-bug
-------------------------+-------------------------------------------------
The `get_edit_comment_link()` function currently always returns its URL
with HTML entities included, specifically `&` (`&`). This makes sense
when including the URL in HTML content, but this may not be the only
context where such a link is used.
For exactly the same purpose, the `get_edit_post_link()` function already
has a `$context` parameter with a default value of "display".
Alternatively, "raw" can be provided to not include the HTML entity
`&`, but the regular `&`.
It would make sense to introduce the same optional `$context` parameter to
`get_edit_comment_link()`. If "raw" is provided, the function could return
the URL to edit the comment without the HTML entity.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61727>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list