Make WordPress Core


Ignore:
Timestamp:
10/03/2024 12:23:53 AM (19 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-admin/includes/class-plugin-upgrader.php

    r57658 r59159  
    275275     * @since 3.7.0 The `$args` parameter was added, making clearing the plugin update cache optional.
    276276     *
    277      * @global string $wp_version The WordPress version string.
    278      *
    279277     * @param string[] $plugins Array of paths to plugin files relative to the plugins directory.
    280278     * @param array    $args {
     
    286284     */
    287285    public function bulk_upgrade( $plugins, $args = array() ) {
    288         global $wp_version;
     286        $wp_version = wp_get_wp_version();
    289287
    290288        $defaults    = array(
     
    458456     *
    459457     * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
    460      * @global string             $wp_version    The WordPress version string.
    461458     *
    462459     * @param string $source The path to the downloaded package source.
     
    464461     */
    465462    public function check_package( $source ) {
    466         global $wp_filesystem, $wp_version;
    467 
     463        global $wp_filesystem;
     464
     465        $wp_version            = wp_get_wp_version();
    468466        $this->new_plugin_data = array();
    469467
Note: See TracChangeset for help on using the changeset viewer.