[wp-trac] [WordPress Trac] #60526: Comment fields filter missing
WordPress Trac
noreply at wordpress.org
Tue Feb 13 15:15:04 UTC 2024
#60526: Comment fields filter missing
--------------------------+-----------------------------
Reporter: ttodua | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
so, take:
{{{
add_filter('comment_form_default_fields', 'website_remove');
function website_remove($fields)
{
if( isset($fields['url']) )
unset($fields['url']);
return $fields;
}
}}}
it only removes 'url' input field from output of comment form visually and
it does not have any point, because in backend
https://core.trac.wordpress.org/browser/tags/6.4.2/src/wp-
includes/comment.php#L3460 it is still accepted. So, indeptendently
whether you have shown it on front-end or not, bots can still submit form-
data with `url` field included.
that filter should be supposed to affect both front-end and back-end,
otherwise that filter is useless (we can just do `display:none` for those
fields).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60526>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list