wp_check_php_version example

if ( $check_browser && $check_browser['upgrade'] ) {
        add_filter( 'postbox_classes_dashboard_dashboard_browser_nag', 'dashboard_browser_nag_class' );

        if ( $check_browser['insecure'] ) {
            wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );
        } else {
            wp_add_dashboard_widget( 'dashboard_browser_nag', __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );
        }
    }

    // PHP Version.     $check_php = wp_check_php_version();

    if ( $check_php && current_user_can( 'update_php' ) ) {
        // If "not acceptable" the widget will be shown.         if ( isset( $check_php['is_acceptable'] ) && ! $check_php['is_acceptable'] ) {
            add_filter( 'postbox_classes_dashboard_dashboard_php_nag', 'dashboard_php_nag_class' );

            if ( $check_php['is_lower_than_future_minimum'] ) {
                wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Required' ), 'wp_dashboard_php_nag' );
            } else {
                wp_add_dashboard_widget( 'dashboard_php_nag', __( 'PHP Update Recommended' ), 'wp_dashboard_php_nag' );
            }
        }
return $result;
    }

    /** * Tests if the supplied PHP version is supported. * * @since 5.2.0 * * @return array The test results. */
    public function get_test_php_version() {
        $response = wp_check_php_version();

        $result = array(
            'label'       => sprintf(
                /* translators: %s: The current PHP version. */
                __( 'Your site is running the current version of PHP (%s)' ),
                PHP_VERSION
            ),
            'status'      => 'good',
            'badge'       => array(
                'label' => __( 'Performance' ),
                'color' => 'blue',
            ),
Home | Imprint | This part of the site doesn't use cookies.