Make WordPress Core

Opened 10 months ago

Closed 9 months ago

#60526 closed defect (bug) (duplicate)

Comment fields filter missing

Reported by: ttodua's profile ttodua Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: Cc:

Description

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).

Attachments (1)

60526.patch (952 bytes) - added by ttodua 10 months ago.

Download all attachments as: .zip

Change History (3)

@ttodua
10 months ago

#1 @ttodua
10 months ago

#49869 was marked as a duplicate.

#2 @sabernhardt
9 months ago

  • Component changed from General to Comments
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#49869 is the better choice to keep open. It has history and discussion.

Note: See TracTickets for help on using tickets.