Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2020 11:33:35 AM (4 years ago)
Author:
imath
Message:

Prepare the inclusion of the BP REST API remaining endpoints

6.0.0 is introducing 6 new BP REST API endpoints :

  • Blogs, Blog avatar,
  • Friends,
  • Group Cover image,
  • Member Cover Image and User Signups

We're also reorganizing files, making sure they are located to their belonging endpoints. As a result, 2 files are now deprecated:

  • bp-core/classes/class-bp-rest-attachments-group-avatar-endpoint.php (moved into bp-groups/classes)
  • bp-core/classes/class-bp-rest-attachments-member-avatar-endpoint.php (moved into bp-members/classes)

Props espellcaste, boonebgorges & I ;)

Fixes #7156

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r12587 r12607  
    357357        parent::setup_cache_groups();
    358358    }
     359
     360    /**
     361     * Init the BP REST API.
     362     *
     363     * @since 6.0.0
     364     *
     365     * @param array $controllers Optional. See BP_Component::rest_api_init() for
     366     *                           description.
     367     */
     368    public function rest_api_init( $controllers = array() ) {
     369        if ( is_multisite() ) {
     370            $controllers = array(
     371                'BP_REST_Blogs_Endpoint',
     372            );
     373
     374            // Support to Blog Avatar.
     375            if ( bp_is_active( 'blogs', 'site-icon' ) ) {
     376                $controllers[] = 'BP_REST_Attachments_Blog_Avatar_Endpoint';
     377            }
     378        }
     379
     380        parent::rest_api_init( $controllers );
     381    }
    359382}
Note: See TracChangeset for help on using the changeset viewer.