WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/01/2020 04:22:25 AM (11 months ago)
Author:
TimothyBlynJacobs
Message:

REST API: Introduce plugin management and block directory endpoints.

These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.

Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r48115 r48242  
    174174
    175175        if ( $ssl && is_wp_error( $request ) ) {
    176             trigger_error(
    177                 sprintf(
    178                     /* translators: %s: Support forums URL. */
    179                     __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
    180                     __( 'https://wordpress.org/support/forums/' )
    181                 ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
    182                 headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
    183             );
     176            if ( ! wp_is_json_request() ) {
     177                trigger_error(
     178                    sprintf(
     179                        /* translators: %s: Support forums URL. */
     180                        __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
     181                        __( 'https://wordpress.org/support/forums/' )
     182                    ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
     183                    headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     184                );
     185            }
     186
    184187            $request = wp_remote_get( $http_url, $http_args );
    185188        }
Note: See TracChangeset for help on using the changeset viewer.