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-includes/block-template-utils.php

    r59101 r59159  
    14051405 * @since 6.0.0 Adds the whole theme to the export archive.
    14061406 *
    1407  * @global string $wp_version The WordPress version string.
    1408  *
    14091407 * @return WP_Error|string Path of the ZIP file or error on failure.
    14101408 */
    14111409function wp_generate_block_templates_export_file() {
    1412     global $wp_version;
     1410    $wp_version = wp_get_wp_version();
    14131411
    14141412    if ( ! class_exists( 'ZipArchive' ) ) {
Note: See TracChangeset for help on using the changeset viewer.