Core_Command::is_installed PHP Method

is_installed() public method

Determines whether WordPress is installed by checking if the standard database tables are installed. Doesn't produce output; uses exit codes to communicate whether WordPress is installed. [--network] : Check if this is a multisite install. ## EXAMPLES # Check whether WordPress is installed; exit status 0 if installed, otherwise 1 $ wp core is-installed $ echo $? 1 # Bash script for checking whether WordPress is installed or not if ! $(wp core is-installed); then wp core install fi
public is_installed ( $_, $assoc_args )
    public function is_installed($_, $assoc_args)
    {
        if (\WP_CLI\Utils\get_flag_value($assoc_args, 'network')) {
            if (is_blog_installed() && is_multisite()) {
                WP_CLI::halt(0);
            } else {
                WP_CLI::halt(1);
            }
        } else {
            if (is_blog_installed()) {
                WP_CLI::halt(0);
            } else {
                WP_CLI::halt(1);
            }
        }
    }