wp_update_php_annotation example

        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( wp_get_update_php_url() ),
            __( 'Learn more about updating PHP' ),
            /* translators: Hidden accessibility text. */
            __( '(opens in a new tab)' )
        );
        ?> </p> <?php
    wp_update_php_annotation();
    wp_direct_php_update_button();
}

/** * Adds an additional class to the PHP nag if the current version is insecure. * * @since 5.1.0 * * @param string[] $classes Array of meta box classes. * @return string[] Modified array of meta box classes. */
if ( ! $compatible_php ) {
        echo '<div class="notice notice-error notice-alt"><p>';
        _e( '<strong>Error:</strong> This plugin <strong>requires a newer version of PHP</strong>.' );
        if ( current_user_can( 'update_php' ) ) {
            printf(
                /* translators: %s: URL to Update PHP page. */
                ' ' . __( '<a href="%s" target="_blank">Click here to learn more about updating PHP</a>.' ),
                esc_url( wp_get_update_php_url() )
            );

            wp_update_php_annotation( '</p><p><em>', '</em>' );
        } else {
            echo '</p>';
        }
        echo '</div>';
    }

    if ( ! $tested_wp ) {
        echo '<div class="notice notice-warning notice-alt"><p>';
        _e( '<strong>Warning:</strong> This plugin <strong>has not been tested</strong> with your current version of WordPress.' );
        echo '</p></div>';
    } elseif ( ! $compatible_wp ) {
        


            if ( ! $compatible_php && ! $compatible_wp ) {
                _e( 'This plugin does not work with your versions of WordPress and PHP.' );
                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                    printf(
                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                        ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                        self_admin_url( 'update-core.php' ),
                        esc_url( wp_get_update_php_url() )
                    );
                    wp_update_php_annotation( '</p><p><em>', '</em>' );
                } elseif ( current_user_can( 'update_core' ) ) {
                    printf(
                        /* translators: %s: URL to WordPress Updates screen. */
                        ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                        self_admin_url( 'update-core.php' )
                    );
                } elseif ( current_user_can( 'update_php' ) ) {
                    printf(
                        /* translators: %s: URL to Update PHP page. */
                        ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                        esc_url( wp_get_update_php_url() )
                    );
__( 'There is a new version of %1$s available, but it does not work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
                    $plugin_name,
                    esc_url( $details_url ),
                    sprintf(
                        'class="thickbox open-plugin-details-modal" aria-label="%s"',
                        /* translators: 1: Plugin name, 2: Version number. */
                        esc_attr( sprintf( __( 'View %1$s version %2$s details' )$plugin_name$response->new_version ) )
                    ),
                    esc_attr( $response->new_version ),
                    esc_url( wp_get_update_php_url() )
                );
                wp_update_php_annotation( '<br><em>', '</em>' );
            }
        }

        /** * Fires at the end of the update message container in each * row of the plugins list table. * * The dynamic portion of the hook name, `$file`, refers to the path * of the plugin's primary file relative to the plugins directory. * * @since 2.8.0 * * @param array $plugin_data An array of plugin metadata. See get_plugin_data() * and the {@see 'plugin_row_meta'} filter for the list * of possible values. * @param object $response { * An object of metadata about the available plugin update. * * @type string $id Plugin ID, e.g. `w.org/plugins/[plugin-name]`. * @type string $slug Plugin slug. * @type string $plugin Plugin basename. * @type string $new_version New plugin version. * @type string $url Plugin URL. * @type string $package Plugin update package URL. * @type string[] $icons An array of plugin icon URLs. * @type string[] $banners An array of plugin banner URLs. * @type string[] $banners_rtl An array of plugin RTL banner URLs. * @type string $requires The version of WordPress which the plugin requires. * @type string $tested The version of WordPress the plugin is tested against. * @type string $requires_php The version of PHP which the plugin requires. * } */
/* translators: %s: Theme name. */
                                            __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
                                            '{{{ data.name }}}'
                                        );
                                        if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                                            printf(
                                                /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                                                ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                                                self_admin_url( 'update-core.php' ),
                                                esc_url( wp_get_update_php_url() )
                                            );
                                            wp_update_php_annotation( '</p><p><em>', '</em>' );
                                        } elseif ( current_user_can( 'update_core' ) ) {
                                            printf(
                                                /* translators: %s: URL to WordPress Updates screen. */
                                                ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                                                self_admin_url( 'update-core.php' )
                                            );
                                        } elseif ( current_user_can( 'update_php' ) ) {
                                            printf(
                                                /* translators: %s: URL to Update PHP page. */
                                                ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                                                esc_url( wp_get_update_php_url() )
                                            );
/* translators: %s: Theme name. */
                        __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
                        $theme['name']
                    );
                    if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                        printf(
                            /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                            ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                            self_admin_url( 'update-core.php' ),
                            esc_url( wp_get_update_php_url() )
                        );
                        wp_update_php_annotation( '</p><p><em>', '</em>' );
                    } elseif ( current_user_can( 'update_core' ) ) {
                        printf(
                            /* translators: %s: URL to WordPress Updates screen. */
                            ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                            self_admin_url( 'update-core.php' )
                        );
                    } elseif ( current_user_can( 'update_php' ) ) {
                        printf(
                            /* translators: %s: URL to Update PHP page. */
                            ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                            esc_url( wp_get_update_php_url() )
                        );
            if ( ! $compatible_php || ! $compatible_wp ) {
                echo '<div class="notice inline notice-error notice-alt"><p>';
                if ( ! $compatible_php && ! $compatible_wp ) {
                    _e( 'This plugin does not work with your versions of WordPress and PHP.' );
                    if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                        printf(
                            /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                            ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                            self_admin_url( 'update-core.php' ),
                            esc_url( wp_get_update_php_url() )
                        );
                        wp_update_php_annotation( '</p><p><em>', '</em>' );
                    } elseif ( current_user_can( 'update_core' ) ) {
                        printf(
                            /* translators: %s: URL to WordPress Updates screen. */
                            ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                            self_admin_url( 'update-core.php' )
                        );
                    } elseif ( current_user_can( 'update_php' ) ) {
                        printf(
                            /* translators: %s: URL to Update PHP page. */
                            ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                            esc_url( wp_get_update_php_url() )
                        );
<?php                 _e( 'This theme does not work with your versions of WordPress and PHP.' );
                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                    printf(
                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                        ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                        self_admin_url( 'update-core.php' ),
                        esc_url( wp_get_update_php_url() )
                    );
                    wp_update_php_annotation( '</p><p><em>', '</em>' );
                } elseif ( current_user_can( 'update_core' ) ) {
                    printf(
                        /* translators: %s: URL to WordPress Updates screen. */
                        ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                        self_admin_url( 'update-core.php' )
                    );
                } elseif ( current_user_can( 'update_php' ) ) {
                    printf(
                        /* translators: %s: URL to Update PHP page. */
                        ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                        esc_url( wp_get_update_php_url() )
                    );
/* translators: %s: Theme name. */
                                    __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
                                    '{{{ data.theme.name }}}'
                                );
                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                                    printf(
                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                                        ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                                        self_admin_url( 'update-core.php' ),
                                        esc_url( wp_get_update_php_url() )
                                    );
                                    wp_update_php_annotation( '</p><p><em>', '</em>' );
                                } elseif ( current_user_can( 'update_core' ) ) {
                                    printf(
                                        /* translators: %s: URL to WordPress Updates screen. */
                                        ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                                        self_admin_url( 'update-core.php' )
                                    );
                                } elseif ( current_user_can( 'update_php' ) ) {
                                    printf(
                                        /* translators: %s: URL to Update PHP page. */
                                        ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
                                        esc_url( wp_get_update_php_url() )
                                    );
Home | Imprint | This part of the site doesn't use cookies.