Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户在仪表板中的博客之间切换时,我可以使用 WordPress 多站点的挂钩吗?
当用户登录仪表板时,我需要清除一些瞬态,但前提是她从一个博客切换到另一个博客。
胡克是你的朋友。
/** * 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/