Make WordPress Core


Ignore:
Timestamp:
10/03/2024 12:23:53 AM (17 months ago)
Author:
peterwilsoncc
Message:

General: Expand use of wp_get_wp_version().

Expands the use of wp_get_wp_version() to get an unmodified value of the current WordPress version in various locations in which it would be unhelpful if a plugin has modified the global $wp_version.

This includes:

  • Theme and plugin compatibility tests
  • During the upgrade process of WP Core
  • Debug and site health data reports of the current version
  • Version number display in the dashboard
  • Block theme export and caching utilities
  • The WPDB class

Props peterwilsoncc, hellofromtonya.
See #61627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wpdb.php

    r59069 r59159  
    39843984     * @since 2.5.0
    39853985     *
    3986      * @global string $wp_version             The WordPress version string.
    39873986     * @global string $required_mysql_version The required MySQL version string.
    39883987     * @return void|WP_Error
    39893988     */
    39903989    public function check_database_version() {
    3991         global $wp_version, $required_mysql_version;
     3990        global $required_mysql_version;
     3991        $wp_version = wp_get_wp_version();
     3992
    39923993        // Make sure the server has the required MySQL version.
    39933994        if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) {
Note: See TracChangeset for help on using the changeset viewer.