0 return the user of blog * @return array */ public static function getAdminUserLists($blogId = 0) { $args = array( 'fields' => array('id', 'user_login') ); if (is_multisite()) { $args['blog_id'] = $blogId; if ($blogId == 0) { $args['login__in'] = get_site_option('site_admins'); } } else { $args['role'] = 'administrator'; } return get_users($args); } public static function getPostTypesCount() { $postTypes = get_post_types(); $postTypeCount = array(); foreach ($postTypes as $postName) { $postObj = get_post_type_object($postName); if (!$postObj->public) { continue; } $postCountForTypes = (array) wp_count_posts($postName); $postCount = 0; foreach ($postCountForTypes as $num) { $postCount += $num; } $postTypeCount[$postObj->label] = $postCount; } return $postTypeCount; } }