0

Is there a hook for WordPress multisite that I can use when a user switches between blogs in the Dashboard?

I need to clear some transients when the user is logged in the Dashboard, but only if she switched from one blog to another.

Cyclonecode
  • 29,115
  • 11
  • 72
  • 93
alkah3st
  • 25
  • 1
  • 8

1 Answers1

0

Hookr is your friend.

    /**
     * Fires when the blog is switched.
     *
     * @since MU
     *
     * @param int $new_blog New blog ID.
     * @param int $new_blog Blog ID.
     */
    do_action( 'switch_blog', $new_blog, $new_blog );

http://hookr.io/3.9.1/actions/do_action/switch_blog/

Adam
  • 4,590
  • 10
  • 51
  • 84