wp_get_direct_php_update_url() WordPress Function

The wp_get_direct_php_update_url() function allows you to update your WordPress installation directly through PHP. This is useful if you do not have access to your WordPress administration panel, or if you want to automate the update process.

wp_get_direct_php_update_url() #

Gets the URL for directly updating the PHP version the site is running on.


Description

A URL will only be returned if the WP_DIRECT_UPDATE_PHP_URL environment variable is specified or by using the ‘wp_direct_php_update_url’ filter. This allows hosts to send users directly to the page where they can update PHP to a newer version.


Top ↑

Return

(string) URL for directly updating PHP or empty string.


Top ↑

Source

File: wp-includes/functions.php

function wp_get_direct_php_update_url() {
	$direct_update_url = '';

	if ( false !== getenv( 'WP_DIRECT_UPDATE_PHP_URL' ) ) {
		$direct_update_url = getenv( 'WP_DIRECT_UPDATE_PHP_URL' );
	}

	/**
	 * Filters the URL for directly updating the PHP version the site is running on from the host.
	 *
	 * @since 5.1.1
	 *
	 * @param string $direct_update_url URL for directly updating PHP.
	 */
	$direct_update_url = apply_filters( 'wp_direct_php_update_url', $direct_update_url );

	return $direct_update_url;
}


Top ↑

Changelog

Changelog
VersionDescription
5.1.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More