Comment cookies consent text
-
Somebody in this thread shared a filter for changing the text on the comment cookies consent form label:
function comment_form_change_cookies_consent( $fields ) { $commenter = wp_get_current_commenter(); $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 modified text here</label></p>'; return $fields; } add_filter( 'comment_form_default_fields', 'comment_form_change_cookies_consent' );The problem with this code is that it disables the ability for the site admin to disable the cookies consent form from within the admin discussion settings.
Is there a way to edit the text of the label, while still allowing the admin who is using my theme to disable the form altogether if desired?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Comment cookies consent text’ is closed to new replies.