• Resolved yoyoma1974

    (@yoyoma1974)


    Hi,

    I have, what I’m pretty sure is, the correct code to change the standard blog comment form checkbox text, “Save my name, email, and website in this browser for the next time I comment.” to custom text, but it seems the snippet is not being applied. This is the code I am using:

    add_filter( 'comment_form_default_fields', 'tu_comment_form_change_cookies_consent' );
    function tu_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">Please, tick this box to give us permission to contact you by email</label></p>';
    return $fields;
    }

    Thanks,

    Tim

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Temyk

    (@webtemyk)

    Hello.

    In the PHP snippet settings, select Run Everywhere.

    Thread Starter yoyoma1974

    (@yoyoma1974)

    I already had that selected, so that can’t be the issue.

    https://share.getcloudapp.com/kpu7gQzW

    Tim

    Plugin Support Temyk

    (@webtemyk)

    Do you have any additional snippet placement logic below?

    Perhaps your theme does not support this functionality. Try activating one of the standard themes.

    Thread Starter yoyoma1974

    (@yoyoma1974)

    I don’t even see a place to add snippet placement logic… am I missing something.

    Also Woody is working for a js snippet I am using.

    Plugin Support Temyk

    (@webtemyk)

    Take a screenshot of the entire snippet page

    Thread Starter yoyoma1974

    (@yoyoma1974)

    Plugin Support Temyk

    (@webtemyk)

    I copied your snippet to myself, and it works on my site. Do you have an updated plugin? Is your snippet turn on in the snippet list?

    Thread Starter yoyoma1974

    (@yoyoma1974)

    Weird, it’s suddenly working, but I didn’t change anything.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Code not being applied’ is closed to new replies.