• Resolved CaptainMorgan

    (@davehealey)


    I’m trying to override the wp_password_change_notification function using the below code but I’m getting the Cannot redeclare error. Is there a solution?

    if ( !function_exists( 'wp_password_change_notification' ) ) {
        function wp_password_change_notification() {}
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @davehealey,

    This is a known bug in the current version. It will be fixed in the next release.

    Thread Starter CaptainMorgan

    (@davehealey)

    Ok, thanks, I’ll wait for the next version 🙂

    Should this still be happening? I’m using version 2.14.0 of the Code Snippets plugin (WordPress is 5.5.3 if that matters).

    Snippet is a little bit different but the same thing is happening. I’ve tried using a few different versions of this code and they all seem to give the same error:

    View post on imgur.com

    Steve

    (@steveholland)

    I have no idea why, but the following code is not working and it’s driving me nuts!

    I am getting 10 or more “Password Changed” emails per day on an active website.

    if (!function_exists('wp_password_change_notification')) {
        function wp_password_change_notification($user) {
        return;
        }
    }
    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @steveholland,

    Are you getting the same error when you try to save this snippet? If not, and it’s just that the code isn’t working, then please start a new thread in this forum and I’ll do my best to help you out.

    Thread Starter CaptainMorgan

    (@davehealey)

    I’m no longer getting the error but the snippet isn’t working for me. I’m still getting password changed emails.

    Thread Starter CaptainMorgan

    (@davehealey)

    Actually it seems to be working now, maybe I forgot to hit apply

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Override WP function = Cannot redeclare function’ is closed to new replies.