When customizing my website i tried to hide “email” and “website” fields from the “leave a reply” section (comments). I managed to do this by adding the following code in functions.php
function remove_email_url($fields){
unset($fields[‘url’]);
unset($fields[’email’]);
return $fields;
}
add_filter(‘comment_form_default_fields’, ‘remove_email_url’);
Every time i updated the theme i had to do it again. Today when i updated the theme i added the code again and i received an error: “Your PHP code changes were rolled back due to an error……”. I will attach screenshot.
Is there a way to solve this problem without the need to add it again every time i update, like adding code in “custom code” section ?
Attachments:
You must be
logged in to view attached files.