wp_get_update_php_annotation example

/* translators: %s: WordPress version. */
                esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
                sanitize_title( $update->current )
            );

            $php_update_message = '</p><p>' . sprintf(
                /* translators: %s: URL to Update PHP page. */
                __( '<a href="%s">Learn more about updating PHP</a>.' ),
                esc_url( wp_get_update_php_url() )
            );

            $annotation = wp_get_update_php_annotation();

            if ( $annotation ) {
                $php_update_message .= '</p><p><em>' . $annotation . '</em>';
            }

            if ( ! $mysql_compat && ! $php_compat ) {
                $message = sprintf(
                    /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */
                    __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
                    $version_url,
                    $update->current,
                    

function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>' ) {
    $annotation = wp_get_update_php_annotation();

    if ( $annotation ) {
        echo $before . $annotation . $after;
    }
}

/** * Returns the default annotation for the web hosting altering the "Update PHP" page URL. * * This function is to be used after {@see wp_get_update_php_url()} to return a consistent * annotation if the web host has altered the default "Update PHP" page URL. * * @since 5.2.0 * * @return string Update PHP page annotation. An empty string if no custom URLs are provided. */
$php_update_message = '';

    if ( function_exists( 'wp_get_update_php_url' ) ) {
        $php_update_message = '</p><p>' . sprintf(
            /* translators: %s: URL to Update PHP page. */
            __( '<a href="%s">Learn more about updating PHP</a>.' ),
            esc_url( wp_get_update_php_url() )
        );

        if ( function_exists( 'wp_get_update_php_annotation' ) ) {
            $annotation = wp_get_update_php_annotation();

            if ( $annotation ) {
                $php_update_message .= '</p><p><em>' . $annotation . '</em>';
            }
        }
    }

    if ( ! $mysql_compat && ! $php_compat ) {
        return new WP_Error(
            'php_mysql_not_compatible',
            sprintf(
                
/* translators: %s: WordPress version. */
    esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
    sanitize_title( $wp_version )
);

$php_update_message = '</p><p>' . sprintf(
    /* translators: %s: URL to Update PHP page. */
    __( '<a href="%s">Learn more about updating PHP</a>.' ),
    esc_url( wp_get_update_php_url() )
);

$annotation = wp_get_update_php_annotation();

if ( $annotation ) {
    $php_update_message .= '</p><p><em>' . $annotation . '</em>';
}

if ( ! $mysql_compat && ! $php_compat ) {
    $compat = sprintf(
        /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */
        __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
        $version_url,
        $wp_version,
        


    $compatible_wp  = is_wp_version_compatible( $requirements['requires'] );
    $compatible_php = is_php_version_compatible( $requirements['requires_php'] );

    $php_update_message = '</p><p>' . sprintf(
        /* translators: %s: URL to Update PHP page. */
        __( '<a href="%s">Learn more about updating PHP</a>.' ),
        esc_url( wp_get_update_php_url() )
    );

    $annotation = wp_get_update_php_annotation();

    if ( $annotation ) {
        $php_update_message .= '</p><p><em>' . $annotation . '</em>';
    }

    if ( ! $compatible_wp && ! $compatible_php ) {
        return new WP_Error(
            'plugin_wp_php_incompatible',
            '<p>' . sprintf(
                /* translators: 1: Current WordPress version, 2: Current PHP version, 3: Plugin name, 4: Required WordPress version, 5: Required PHP version. */
                _x( '<strong>Error:</strong> Current versions of WordPress (%1$s) and PHP (%2$s) do not meet minimum requirements for %3$s. The plugin requires WordPress %4$s and PHP %5$s.', 'plugin' ),
                
/* translators: %s: WordPress version. */
        esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
        sanitize_title( $wp_version )
    );

    $php_update_message = '</p><p>' . sprintf(
        /* translators: %s: URL to Update PHP page. */
        __( '<a href="%s">Learn more about updating PHP</a>.' ),
        esc_url( wp_get_update_php_url() )
    );

    $annotation = wp_get_update_php_annotation();

    if ( $annotation ) {
        $php_update_message .= '</p><p><em>' . $annotation . '</em>';
    }

    if ( ! $mysql_compat && ! $php_compat ) {
        $message = sprintf(
            /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */
            __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ),
            $version_url,
            $wp_version,
            
Home | Imprint | This part of the site doesn't use cookies.