Support » Plugin: Simple Google reCAPTCHA » Adding Google Recaptcha to Page Comments

  • Resolved strifemit

    (@strifemit)


    I can’t find how to add google recaptcha to every page that allows comments. I thought this one says it can but I don’t know how. Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • jinbatsu

    (@jinbatsu)

    Dirty Fix:
    /simple-google-recaptcha/simple-google-recaptcha.php
    At line 63:
    if (did_action("login_init") > 0 || function_exists('is_account_page') || function_exists('bp_get_signup_page') || (is_single() && comments_open()) && !is_user_logged_in()) {

    Replace with this:
    if (did_action("login_init") > 0 || function_exists('is_account_page') || function_exists('bp_get_signup_page') || (is_singular() && comments_open()) && !is_user_logged_in()) {

    The different is_single only for post and attachment, but not for page, so change with is_singular.
    Source:
    https://developer.wordpress.org/reference/functions/is_single/
    https://developer.wordpress.org/reference/functions/is_singular/

    • This reply was modified 5 years ago by jinbatsu.
    Plugin Author Minor

    (@minor)

    Hi @strifemit and @jinbatsu,

    thank you for your comments.

    I think that sugested fix is not dirty way, I will implement this solution with new version 2.4.

    Have a nice day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Google Recaptcha to Page Comments’ is closed to new replies.