On this page
wpdb::db_version(): string|null
Retrieves the database server version.
Return
string|null Version number on success, null on failure.
Source
File: wp-includes/class-wpdb.php. View all references
public function db_version() {
return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );
}
Related
Uses
| Uses | Description |
|---|---|
| wpdb::db_server_info() wp-includes/class-wpdb.php | Retrieves full database server information. |
Used By
| Used By | Description |
|---|---|
| WP_Automatic_Updater::should_update() wp-admin/includes/class-wp-automatic-updater.php | Tests to see if we can and should update a specific item. |
| dbDelta() wp-admin/includes/upgrade.php | Modifies the database based on specified SQL statements. |
| update_core() wp-admin/includes/update-core.php | Upgrades the core of WordPress. |
| list_core_update() wp-admin/update-core.php | Lists available core updates. |
| wp_version_check() wp-includes/update.php | Checks WordPress version against the newest version. |
| wpdb::check_database_version() wp-includes/class-wpdb.php | Determines whether MySQL database is at least the required minimum version. |
| wpdb::has_cap() wp-includes/class-wpdb.php | Determines whether the database or WPDB supports a particular feature. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wpdb/db_version