wp_update_php_annotation

The timeline below displays how wordpress function wp_update_php_annotation has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Prints the default annotation for the web host altering the "Update PHP" page URL.
 *
 * This function is to be used after {@see wp_get_update_php_url()} to display a consistent
 * annotation if the web host has altered the default "Update PHP" page URL.
 *
 * @since 5.1.0
 * @since 5.2.0 Added the `$before` and `$after` parameters.
 * @since 6.4.0 Added the `$display` parameter.
 *
 * @param string $before  Markup to output before the annotation. Default `<p class="description">`.
 * @param string $after   Markup to output after the annotation. Default `</p>`.
 * @param bool   $display Whether to echo or return the markup. Default `true` for echo.
 *
 * @return string|void
 */
function wp_update_php_annotation($before = '<p class="description">', $after = '</p>', $display = true)
{
    $annotation = wp_get_update_php_annotation();
    if ($annotation) {
        if ($display) {
            echo $before . $annotation . $after;
        } else {
            return $before . $annotation . $after;
        }
    }
}

WordPress Version: 5.2

/**
 * Prints the default annotation for the web host altering the "Update PHP" page URL.
 *
 * This function is to be used after {@see wp_get_update_php_url()} to display a consistent
 * annotation if the web host has altered the default "Update PHP" page URL.
 *
 * @since 5.1.0
 * @since 5.2.0 Added the `$before` and `$after` parameters.
 *
 * @param string $before Markup to output before the annotation. Default `<p class="description">`.
 * @param string $after  Markup to output after the annotation. Default `</p>`.
 */
function wp_update_php_annotation($before = '<p class="description">', $after = '</p>')
{
    $annotation = wp_get_update_php_annotation();
    if ($annotation) {
        echo $before . $annotation . $after;
    }
}

WordPress Version: 5.1

/**
 * Prints the default annotation for the web host altering the "Update PHP" page URL.
 *
 * This function is to be used after {@see wp_get_update_php_url()} to display a consistent
 * annotation if the web host has altered the default "Update PHP" page URL.
 *
 * @since 5.1.0
 */
function wp_update_php_annotation()
{
    $update_url = wp_get_update_php_url();
    $default_url = wp_get_default_update_php_url();
    if ($update_url === $default_url) {
        return;
    }
    echo '<p class="description">';
    printf(
        /* translators: %s: default Update PHP page URL */
        __('This resource is provided by your web host, and is specific to your site. For more information, <a href="%s" target="_blank">see the official WordPress documentation</a>.'),
        esc_url($default_url)
    );
    echo '</p>';
}