Title: wp_direct_php_update_button
Published: March 13, 2019
Last modified: February 24, 2026

---

# wp_direct_php_update_button()

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#wp--skip-link--target)

Displays a button directly linking to a PHP update process.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#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()`.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#source)󠁿

    ```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">%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: Hidden accessibility text. */
    		__( '(opens in a new tab)' )
    	);
    	echo '</p>';
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/functions.php#L8609)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/functions.php#L8609-L8625)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_direct_php_update_url()](https://developer.wordpress.org/reference/functions/wp_get_direct_php_update_url/)`wp-includes/functions.php` |

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

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#)

| Used by | Description | 
| [wp_dashboard_php_nag()](https://developer.wordpress.org/reference/functions/wp_dashboard_php_nag/)`wp-admin/includes/dashboard.php` |

Displays the PHP update nag.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_direct_php_update_button/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.1.1](https://developer.wordpress.org/reference/since/5.1.1/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_direct_php_update_button%2F)
before being able to contribute a note or feedback.