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.
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.
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 );