add options to edit custom_comment_checkbox_text
-
add options to edit custom_comment_checkbox_text as removing website field does no remove website from wp-comment-cookies-consent Save my name, email, and website in this browser for the next time I comment. below if the code snippet im using in the custom I’m currently making for myself.
// Function to modify the text next to the checkbox function universal_comment_checkbox_text($fields) { $commenter = wp_get_current_commenter(); $consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"'; $fields['cookies'] = '<p class="comment-form-cookies-consent"><label for="wp-comment-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' . 'Save my info in this browser for the next time I comment.</label></p>'; return $fields; } add_filter('comment_form_default_fields', 'custom_comment_checkbox_text');
pulse if the can create a comments policy page and add below
comment-form-cookies-consent
like thisfunction wpbeginner_comment_text_before($arg) { $arg['comment_notes_before'] .= '<p class="comment-policy"">We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our <a >comment policy</a>.</p>'; return $arg; } add_filter('comment_form_defaults', 'wpbeginner_comment_text_before');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add options to edit custom_comment_checkbox_text’ is closed to new replies.