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.



Built from https://develop.svn.wordpress.org/trunk@59159


git-svn-id: http://core.svn.wordpress.org/trunk@58554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson
2024-10-03 00:25:15 +00:00
parent 49ed36d717
commit 92d9e70f84
15 changed files with 31 additions and 39 deletions

View File

@@ -2056,7 +2056,7 @@ function wp_dashboard_empty() {}
* @since 5.9.0 Send users to the Site Editor if the active theme is block-based.
*/
function wp_welcome_panel() {
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
list( $display_version ) = explode( '-', wp_get_wp_version() );
$can_customize = current_user_can( 'customize' );
$is_block_theme = wp_is_block_theme();
?>
@@ -2070,7 +2070,7 @@ function wp_welcome_panel() {
<a href="<?php echo esc_url( admin_url( 'about.php' ) ); ?>">
<?php
/* translators: %s: Current WordPress version. */
printf( __( 'Learn more about the %s version.' ), $display_version );
printf( __( 'Learn more about the %s version.' ), esc_html( $display_version ) );
?>
</a>
</p>