Making WordPress.org


Ignore:
Timestamp:
02/11/2020 12:59:16 PM (7 years ago)
Author:
ocean90
Message:

Support Forums: After ​[WP47260], check if route exists first to avoid a PHP warning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-performance-optimizations.php

    r9302 r9491  
    7979         */
    8080        public function disable_rest_api_users_endpoint( $endpoints ) {
     81                if ( ! isset( $endpoints['/wp/v2/users'] ) ) {
     82                        return $endpoints;
     83                }
     84
    8185                foreach ( $endpoints['/wp/v2/users'] as &$handler ) {
    8286                        if ( isset( $handler['methods'] ) && 'GET' === $handler['methods'] ) {
    … …  
    467471        /**
    468472         * Block forum subscriptions.
    469          * 
     473         *
    470474         * No user ever actually intends to subscribe to an entire forum, so lets just never do that.
    471475         */
Note: See TracChangeset for help on using the changeset viewer.