wp_direct_php_update_button() WordPress Function

The wp_direct_php_update_button() function allows you to update your WordPress site directly from your PHP code. This function is useful for those who want to update their WordPress site without having to use the WordPress admin interface.

wp_direct_php_update_button() #

Display a button directly linking to a PHP update process.


Description

This provides hosts with a way for users to be sent directly to their PHP update process.

The button is only displayed if a URL is returned by wp_get_direct_php_update_url().


Top ↑

Source

File: wp-includes/functions.php

function wp_direct_php_update_button() {
	$direct_update_url = wp_get_direct_php_update_url();

	if ( empty( $direct_update_url ) ) {
		return;
	}

	echo '<p class="button-container">';
	printf(
		'<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
		esc_url( $direct_update_url ),
		__( 'Update PHP' ),
		/* translators: Accessibility text. */
		__( '(opens in a new tab)' )
	);
	echo '</p>';
}


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