【问题标题】:Hook when switching between blogs in WordPress multisite?在 WordPress 多站点中的博客之间切换时挂钩?
【发布时间】:2014-10-15 13:41:08
【问题描述】:

当用户在仪表板中的博客之间切换时,我可以使用 WordPress 多站点的挂钩吗?

当用户登录仪表板时,我需要清除一些瞬态,但前提是她从一个博客切换到另一个。

【问题讨论】:

    标签: hook wordpress transient multisite


    【解决方案1】:

    Hookr 是你的朋友。

        /**
         * 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/

    【讨论】:

      猜你喜欢
      • 2015-04-16
      • 2016-03-18
      • 1970-01-01
      • 1970-01-01
      • 2012-06-21
      • 2012-08-24
      • 1970-01-01
      • 2021-04-16
      • 1970-01-01
      相关资源
      最近更新 更多