choose_primary_blog

The timeline below displays how wordpress function choose_primary_blog has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * 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()
{
    ?>
	<table class="form-table" role="presentation">
	<tr>
	<?php 
    /* translators: My Sites label. */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = (int) get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($blog->userblog_id === $primary_blog) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (1 === count($all_blogs)) {
        $blog = reset($all_blogs);
        echo esc_url(get_home_url($blog->userblog_id));
        if ($blog->userblog_id !== $primary_blog) {
            // 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 {
        _e('Not available');
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 5.9

/**
 * 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()
{
    ?>
	<table class="form-table" role="presentation">
	<tr>
	<?php 
    /* translators: My Sites label. */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = (int) get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($blog->userblog_id === $primary_blog) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (1 === count($all_blogs)) {
        $blog = reset($all_blogs);
        echo esc_url(get_home_url($blog->userblog_id));
        if ($blog->userblog_id !== $primary_blog) {
            // 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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 5.3

/**
 * 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()
{
    ?>
	<table class="form-table" role="presentation">
	<tr>
	<?php 
    /* translators: My Sites label. */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: .20

/**
 * 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()
{
    ?>
	<table class="form-table" role="presentation">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 2.2

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: .10

/**
 * 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()
{
    ?>
	<table class="form-table" role="presentation">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 5.1

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?>
					<option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option>
					<?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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';
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 4.4

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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";
    }
    ?>
		</td>
	</tr>
	</table>
	<?php 
}

WordPress Version: 4.3

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->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";
    }
    ?>
		</td>
	</tr>
	<?php 
    if (in_array(get_site_option('registration'), array('all', 'blog'))) {
        ?>
		<tr>
			<th scope="row" colspan="2" class="th-full">
				<?php 
        /** This filter is documented in wp-login.php */
        $sign_up_url = apply_filters('wp_signup_location', network_site_url('wp-signup.php'));
        ?>
				<a href="<?php 
        echo esc_url($sign_up_url);
        ?>"><?php 
        _e('Create a New Site');
        ?></a>
			</th>
		</tr>
	<?php 
    }
    ?>
	</table>
	<?php 
}

WordPress Version: 4.2

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><label for="primary_blog"><?php 
    _e('Primary Site');
    ?></label></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog" id="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = reset($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (count($all_blogs) == 1) {
        $blog = reset($all_blogs);
        echo $blog->domain;
        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";
    }
    ?>
		</td>
	</tr>
	<?php 
    if (in_array(get_site_option('registration'), array('all', 'blog'))) {
        ?>
		<tr>
			<th scope="row" colspan="2" class="th-full">
				<?php 
        /** This filter is documented in wp-login.php */
        $sign_up_url = apply_filters('wp_signup_location', network_site_url('wp-signup.php'));
        ?>
				<a href="<?php 
        echo esc_url($sign_up_url);
        ?>"><?php 
        _e('Create a New Site');
        ?></a>
			</th>
		</tr>
	<?php 
    }
    ?>
	</table>
	<?php 
}

WordPress Version: 4.1

/**
 * 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()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><?php 
    _e('Primary Site');
    ?></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = array_shift($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (count($all_blogs) == 1) {
        $blog = array_shift($all_blogs);
        echo $blog->domain;
        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";
    }
    ?>
		</td>
	</tr>
	<?php 
    if (in_array(get_site_option('registration'), array('all', 'blog'))) {
        ?>
		<tr>
			<th scope="row" colspan="2" class="th-full">
				<?php 
        /** This filter is documented in wp-login.php */
        $sign_up_url = apply_filters('wp_signup_location', network_site_url('wp-signup.php'));
        ?>
				<a href="<?php 
        echo esc_url($sign_up_url);
        ?>"><?php 
        _e('Create a New Site');
        ?></a>
			</th>
		</tr>
	<?php 
    }
    ?>
	</table>
	<?php 
}

WordPress Version: 4.0

function choose_primary_blog()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><?php 
    _e('Primary Site');
    ?></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = array_shift($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (count($all_blogs) == 1) {
        $blog = array_shift($all_blogs);
        echo $blog->domain;
        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";
    }
    ?>
		</td>
	</tr>
	<?php 
    if (in_array(get_site_option('registration'), array('all', 'blog'))) {
        ?>
		<tr>
			<th scope="row" colspan="2" class="th-full">
				<?php 
        /** This filter is documented in wp-login.php */
        $sign_up_url = apply_filters('wp_signup_location', network_site_url('wp-signup.php'));
        ?>
				<a href="<?php 
        echo esc_url($sign_up_url);
        ?>"><?php 
        _e('Create a New Site');
        ?></a>
			</th>
		</tr>
	<?php 
    }
    ?>
	</table>
	<?php 
}

WordPress Version: 3.7

function choose_primary_blog()
{
    ?>
	<table class="form-table">
	<tr>
	<?php 
    /* translators: My sites label */
    ?>
		<th scope="row"><?php 
    _e('Primary Site');
    ?></th>
		<td>
		<?php 
    $all_blogs = get_blogs_of_user(get_current_user_id());
    $primary_blog = get_user_meta(get_current_user_id(), 'primary_blog', true);
    if (count($all_blogs) > 1) {
        $found = false;
        ?>
			<select name="primary_blog">
				<?php 
        foreach ((array) $all_blogs as $blog) {
            if ($primary_blog == $blog->userblog_id) {
                $found = true;
            }
            ?><option value="<?php 
            echo $blog->userblog_id;
            ?>"<?php 
            selected($primary_blog, $blog->userblog_id);
            ?>><?php 
            echo esc_url(get_home_url($blog->userblog_id));
            ?></option><?php 
        }
        ?>
			</select>
			<?php 
        if (!$found) {
            $blog = array_shift($all_blogs);
            update_user_meta(get_current_user_id(), 'primary_blog', $blog->userblog_id);
        }
    } elseif (count($all_blogs) == 1) {
        $blog = array_shift($all_blogs);
        echo $blog->domain;
        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";
    }
    ?>
		</td>
	</tr>
	<?php 
    if (in_array(get_site_option('registration'), array('all', 'blog'))) {
        ?>
		<tr>
			<th scope="row" colspan="2" class="th-full">
				<?php 
        $signup_url = network_site_url('wp-signup.php');
        /** This filter is documented in wp-login.php */
        ?>
				<a href="<?php 
        echo apply_filters('wp_signup_location', $signup_url);
        ?>"><?php 
        _e('Create a New Site');
        ?></a>
			</th>
		</tr>
	<?php 
    }
    ?>
	</table>
	<?php 
}