• Resolved arrogance-is-bliss

    (@arrogance-is-bliss)


    Trying to edit a snippet that changes the default WP Email Address on multisite I get the following on all multisites I try with.

    “Don’t Panic

    The code snippet you are trying to save produced a fatal error on line 7:
    Cannot redeclare new_mail_from() (previously declared in /home/ko2czi9cyc8/public_html/nco-c8/wp-content/plugins/code-snippets/php/snippet-ops.php(433) : eval()’d code:5)

    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.”

    If I save and deactivate and then do a save and activate of the snippet I get no error. Thought you might like to know.

    I have “Run snippet everywhere” with “Allow this snippet to be activated on individual sites on the network” unchecked, in the Network Dashboard.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Thank you for reporting this! I’ve worked out what’s going wrong, and I will include a patch in the next plugin release.

    A temporary workaround would be to disable the snippet while you edit it, and then only activate once the edits are finished.

    Or, even better would be to rework your code so instead of using named functions, you use closures, like so:

    add_filter( 'filter_name', function () { 
         // ...
    } );

    instead of:

    function my_function_name() {
        // ...
    }
    
    add_filter( 'filter_name', 'my_function_name' );
    Plugin Author Shea Bunge

    (@bungeshea)

    This has been fixed in version 2.10.0.

    Thread Starter arrogance-is-bliss

    (@arrogance-is-bliss)

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to save edits on Multisite since v2.9.6.’ is closed to new replies.