您可以筛选get_blogs_of_user
并将此特定博客添加到返回的列表中。伪代码,未测试:
add_filter( \'get_blogs_of_user\', \'add_special_blog\', 10, 3 );
function add_special_blog( $blogs, $user_id, $all )
{
$new_blog = get_blog_details( $special_blog_id );
$blogs[ $special_blog_id ] = (object) array(
\'userblog_id\' => $special_blog_id,
\'blogname\' => $new_blog->blogname,
\'domain\' => $new_blog->domain,
\'path\' => $new_blog->path,
\'site_id\' => $new_blog->site_id,
\'siteurl\' => $new_blog->siteurl,
\'archived\' => 0,
\'spam\' => 0,
\'deleted\' => 0
);
return $blogs;
}