Add placeholder attribute to comment form fields
You should filter ‘comment_form_default_fields’ to add the placeholder attribute. Sample code add_filter( ‘comment_form_default_fields’, ‘wpse_62742_comment_placeholders’ ); /** * Change default fields, add placeholder and change type attributes. * * @param array $fields * @return array */ function wpse_62742_comment_placeholders( $fields ) { $fields[‘author’] = str_replace( ‘<input’, ‘<input placeholder=”‘ /* Replace ‘theme_text_domain’ with your theme’s text domain. * … Read more