wpdb::check_database_version() WordPress Method

The wpdb::check_database_version() method is used to check the version of the WordPress database. This is useful for upgrading the database schema when upgrading WordPress.

wpdb::check_database_version() #

Determines whether MySQL database is at least the required minimum version.


Return

(void|WP_Error)


Top ↑

Source

File: wp-includes/wp-db.php

	public function check_database_version() {
		global $wp_version, $required_mysql_version;
		// Make sure the server has the required MySQL version.
		if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) {
			/* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */
			return new WP_Error( 'database_version', sprintf( __( '<strong>Error</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.