W3cubDocs

/WordPress

wp_get_wp_version(): string

Returns the current WordPress version.

Description

Returns an unmodified value of $wp_version. Some plugins modify the global in an attempt to improve security through obscurity. This practice can cause errors in WordPress, so the ability to get an unmodified version is needed.

Return

string The current WordPress version.

Source

function wp_get_wp_version() {
	static $wp_version;

	if ( ! isset( $wp_version ) ) {
		require ABSPATH . WPINC . '/version.php';
	}

	return $wp_version;
}

Changelog

Version Description
6.7.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_wp_version