• Resolved sotospeak

    (@sotospeak)


    I executed a snippet in a multisite WP (from blog_id=2) with:

    global $switched; //suppose this is the problem

    switch_to_blog(1); //error!

    Now the only way I have to access blog(2) is disabling WpCode. Even if I uninstall WpCode and reinstall, from the moment I enable the plugin I can not access blog(2). Tried to delete the entire snippet from the database (table wp_2_posts) but no luck.

    How can I delete those statements so that I can reinstall WpCode? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @sotospeak,

    The easiest way to get around that is to enable the safe mode following the instructions on this page: https://wpcode.com/docs/php-error-handling-safe-mode/

    Once you are in safe mode, no WPCode snippets will get executed so you can reset the pre-loaded snippets by activating another snippet. You won’t be able to deactivate the active snippets you had as you deleted them from the database. If you run into a similar issue in the future I suggest not making any database edits and use the safe mode to disable the snippet causing an error.

    Thread Starter sotospeak

    (@sotospeak)

    Hi Mircea,

    as I had deleted my failed script from db, no use of enabling safe mode at this point, I think.

    Fortunately I was able to find the db table where the cached version of my failed script was stored. I deleted it and everything is fine now.

    Thanks for your time.

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

The topic ‘problem after switch_to_blog()’ is closed to new replies.