Make WordPress Core

Changeset 58826


Ignore:
Timestamp:
07/29/2024 02:50:44 PM (9 months ago)
Author:
SergeyBiryukov
Message:

General: Move wp_get_wp_version() to a more appropriate place.

This places the function in a more predictable location, next to the is_wp_version_compatible() and is_php_version_compatible() functions.

Follow-up to [58813].

See #61627.

File:
1 edited

Legend:

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

    r58813 r58826  
    88098809
    88108810/**
     8811 * Returns the current WordPress version.
     8812 *
     8813 * Returns an unmodified value of `$wp_version`. Some plugins modify the global
     8814 * in an attempt to improve security through obscurity. This practice can cause
     8815 * errors in WordPress, so the ability to get an unmodified version is needed.
     8816 *
     8817 * @since 6.7.0
     8818 *
     8819 * @return string The current WordPress version.
     8820 */
     8821function wp_get_wp_version() {
     8822    require ABSPATH . WPINC . '/version.php';
     8823
     8824    return $wp_version;
     8825}
     8826
     8827/**
    88118828 * Checks compatibility with the current WordPress version.
    88128829 *
     
    90079024    echo wp_kses_post( wp_get_admin_notice( $message, $args ) );
    90089025}
    9009 
    9010 /**
    9011  * Returns the current WordPress Version.
    9012  *
    9013  * Returns an unmodified version of `$wp_version`. Some plugins modify the
    9014  * global in an attempt to improve security through obscurity. This
    9015  * practice can cause errors in WordPress so the ability to get an
    9016  * unmodified version is needed.
    9017  *
    9018  * @since 6.7.0
    9019  *
    9020  * @return string The current WordPress Version.
    9021  */
    9022 function wp_get_wp_version() {
    9023     require ABSPATH . WPINC . '/version.php';
    9024 
    9025     return $wp_version;
    9026 }
Note: See TracChangeset for help on using the changeset viewer.