choose_primary_blog()
choose_primary_blog() 处理选择用户主站点的显示。Handles the display …
choose_primary_blog()
处理选择用户主站点的显示。
Handles the display of choosing a user’s primary site.
目录锚点:#说明#返回#源码
说明(Description)
这将显示用户的主站点,并允许用户选择哪个站点是主站点。
返回(Return)
无返回值
源码(Source)
/**
* Handles the display of choosing a user's primary site.
*
* This displays the user's primary site and allows the user to choose
* which site is primary.
*
* @since 3.0.0
*/
function choose_primary_blog() {
?>
1 ) {
$found = false;
?>
userblog_id )
$found = true;
?>userblog_id ); ?>>userblog_id ) ) ?>
userblog_id );
}
} elseif ( count( $all_blogs ) == 1 ) {
$blog = reset( $all_blogs );
echo esc_url( get_home_url( $blog->userblog_id ) );
if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
} else {
echo "N/A";
}
?>| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.0.0 | wp-admin/includes/ms.php:758 | 0 | 8 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!