[wp-hackers] Questions Related To Improving WP Installation

Beau Lebens beau at dentedreality.com.au
Sat Jan 23 20:25:56 UTC 2010

> 2 ) Is there a better way to get the number of users in the database than
> using: count( get_users_of_blog() ), because that function creates an error
> due to the fact that there isn't a database table during step 2 of the
> install process.

If this is during the installation process, and the table doesn't even
exist yet, isn't it a fair bet that there are no users?

Failing that (perhaps installing against an existing table for a
shared install of some sort?) Maybe you need to do a direct, manual
check first to confirm that the table exists (SHOW TABLES LIKE
'{$prefix}users'), and then use get_users_of_blog() if it does, or
assume no users if the table doesn't exist.

More information about the wp-hackers mailing list