wpdb::db_version() WordPress Method

The wpdb::db_version() method is a quick and easy way to retrieve the WordPress database version number. This can be useful for debugging purposes or for checking if a particular database feature is supported.

wpdb::db_version() #

Retrieves the database server version.


Return

(string|null) Version number on success, null on failure.


Top ↑

Source

File: wp-includes/wp-db.php

	public function db_version() {
		return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );
	}


Top ↑

Changelog

Changelog
VersionDescription
2.7.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.