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;
}
Related
Used by | Description |
---|---|
wp_generate_block_templates_export_file()wp-includes/block-template-utils.php | Creates an export of the current templates and template parts from the site editor at the specified path in a ZIP file. |
WP_REST_Pattern_Directory_Controller::get_items()wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php | Search and retrieve block patterns metadata |
core_auto_updates_settings()wp-admin/update-core.php | Display WordPress auto-updates settings. |
Plugin_Installer_Skin::do_overwrite()wp-admin/includes/class-plugin-installer-skin.php | Checks if the plugin can be overwritten and outputs the HTML for overwriting a plugin on upload. |
Theme_Installer_Skin::do_overwrite()wp-admin/includes/class-theme-installer-skin.php | Checks if the theme can be overwritten and outputs the HTML for overwriting a theme on upload. |
is_wp_version_compatible()wp-includes/functions.php | Checks compatibility with the current WordPress version. |
WP_Site_Health::get_test_wordpress_version()wp-admin/includes/class-wp-site-health.php | Tests for WordPress version and outputs it. |
translations_api()wp-admin/includes/translation-install.php | Retrieve translations from WordPress Translation API. |
wp_get_available_translations()wp-admin/includes/translation-install.php | Get available translations from the WordPress.org API. |
WP_Automatic_Updater::run()wp-admin/includes/class-wp-automatic-updater.php | Kicks off the background update process, looping through all pending updates. |
WP_Automatic_Updater::after_core_update()wp-admin/includes/class-wp-automatic-updater.php | Checks whether to send an email and avoid processing future updates after attempting a core update. |
Plugin_Upgrader::bulk_upgrade()wp-admin/includes/class-plugin-upgrader.php | Upgrades several plugins at once. |
Plugin_Upgrader::check_package()wp-admin/includes/class-plugin-upgrader.php | Checks that the source package contains a valid plugin. |
Theme_Upgrader::bulk_upgrade()wp-admin/includes/class-theme-upgrader.php | Upgrades several themes at once. |
Theme_Upgrader::check_package()wp-admin/includes/class-theme-upgrader.php | Checks that the package source contains a valid theme. |
themes_api()wp-admin/includes/theme.php | Retrieves theme installer pages from the WordPress.org Themes API. |
maintenance_nag()wp-admin/includes/update.php | Displays maintenance nag HTML message. |
core_update_footer()wp-admin/includes/update.php | Returns core update footer message. |
wp_check_browser_version()wp-admin/includes/dashboard.php | Checks if the user needs a browser update. |
wp_welcome_panel()wp-admin/includes/dashboard.php | Displays a welcome panel to introduce users to WordPress. |
plugins_api()wp-admin/includes/plugin-install.php | Retrieves plugin installer pages from the WordPress.org Plugins API. |
wp_get_popular_importers()wp-admin/includes/import.php | Returns a list from WordPress.org of popular importer plugins. |
wp_credits()wp-admin/includes/credits.php | Retrieves the contributor credits. |
list_core_update()wp-admin/update-core.php | Lists available core updates. |
list_plugin_updates()wp-admin/update-core.php | Display the upgrade plugins form. |
wp_version_check()wp-includes/update.php | Checks WordPress version against the newest version. |
wp_update_plugins()wp-includes/update.php | Checks for available updates to plugins based on the latest versions hosted on WordPress.org. |
wp_update_themes()wp-includes/update.php | Checks for available updates to themes based on the latest versions hosted on WordPress.org. |
_maybe_update_core()wp-includes/update.php | Determines whether core should be updated. |
wpdb::check_database_version()wp-includes/class-wpdb.php | Determines whether MySQL database is at least the required minimum version. |
Changelog
Version | Description |
---|---|
6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.