Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#44138 closed enhancement (invalid)

Automatic Message on comment Area mislead visitors

Reported by: marius84's profile Marius84 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.6
Component: Comments Keywords:
Focuses: privacy Cc:

Description

We have no way to change this message on comment Area? “Save my name, email, and website in this browser for the next time I comment.”

So, i don’t request email and website when user left a comment i want to put my personalized message like “Save my name in this browser for the next time I comment.”

On my website i hide the website and email space on comment area. I don't want to request this datas for users when they left a comment.
So why there is no way to change “Save my name, email, and website in this browser for the next time I comment.” with personalized message?

This can mislead visitors thinking that I collect "anonymous" email and website because they are not requested on my site

Change History (4)

#1 follow-up: @SergeyBiryukov
7 years ago

  • Component changed from General to Comments
  • Focuses privacy added

Hi @Marius84, welcome to WordPress Trac!

We have no way to change this message on comment Area? “Save my name, email, and website in this browser for the next time I comment.”

You could change this message using the comment_form_default_fields filter:

function wp44138_change_comment_form_cookies_consent( $fields ) {
	$consent  = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';

	$fields['cookies'] = '<p class="comment-form-cookies-consent">' .
		'<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
		'<label for="wp-comment-cookies-consent">' . __( 'Your desired text.', 'your-text-domain' ) . '</label>' .
		'</p>';

	return $fields;
}
add_filter( 'comment_form_default_fields', 'wp44138_change_comment_form_cookies_consent' );

#2 @Marius84
7 years ago

Hi @SergeyBiryukov where is this more exactly? Everytime i update wordpress i have to do this?
this is not easy for most of the people.

BTW, please close it, i have find the solution Thank you Sergey!

Last edited 7 years ago by Marius84 (previous) (diff)

#3 @desrosj
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Closing out because this has been solved. @Marius84 for future reference, here is more information about using filter hooks.

#4 in reply to: ↑ 1 @superpoincare
7 years ago

Replying to SergeyBiryukov:

function wp44138_change_comment_form_cookies_consent( $fields ) {

$consent = empty( $commentercomment_author_email? ) ? : ' checked="checked"';

The first line in the function should have

$commenter = wp_get_current_commenter();

isn't it?

Note: See TracTickets for help on using tickets.