is_blog_installed()
Test whether WordPress is already installed.
The cache will be checked first. If you have a cache plugin, which saves the cache values, then this will work. If you use the default WordPress cache, and the database goes away, then you might have problems.
Checks for the 'siteurl' option for whether WordPress is installed.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
1 time — 0.000026 sec (very fast) | 50000 times — 0.07 sec (speed of light) | PHP 7.0.14, WP 4.7
No Hooks.
Return
true|false
. Whether the site is already installed.
Usage
is_blog_installed();
Examples
#1 Check if the site is installed, before registering the widget
function widgets_init() { if ( ! is_blog_installed() ) { return; } register_widget( 'WP_Widget_Black_Studio_TinyMCE' ); }
Notes
- Global. wpdb. $wpdb WordPress database abstraction object.
Changelog
Since 2.1.0 | Introduced. |