choose_primary_blog()选择主博客

目录

描述

Displays a form table with fields letting the user choose the primary blog.

choose_primary_blog() 描述

用法

<?php choose_primary_blog(); ?>

choose_primary_blog() 用法

参数

None.

choose_primary_blog() 参数

源文件

choose_primary_blog() 函数的代码位于 wp-admin/includes/ms.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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 ); } } 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"; } ?>

choose_primary_blog() 源文件