Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2020 11:33:35 AM (6 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-members/classes/class-bp-members-component.php

    r12579 r12607  
    655655         *
    656656         * @since 5.0.0
     657         * @since 6.0.0 Adds the Member Cover and Signup REST endpoints.
    657658         *
    658659         * @param array $controllers Optional. See BP_Component::rest_api_init() for
     
    660661         */
    661662        public function rest_api_init( $controllers = array() ) {
    662                 parent::rest_api_init( array(
     663                $controllers = array(
    663664                        /**
    664665                         * As the Members component is always loaded,
     
    668669                        'BP_REST_Members_Endpoint',
    669670                        'BP_REST_Attachments_Member_Avatar_Endpoint',
    670                 ) );
     671                );
     672
     673                if ( bp_is_active( 'members', 'cover_image' ) ) {
     674                        $controllers[] = 'BP_REST_Attachments_Member_Cover_Endpoint';
     675                }
     676
     677                if ( bp_get_signup_allowed() ) {
     678                        $controllers[] = 'BP_REST_Signup_Endpoint';
     679                }
     680
     681                parent::rest_api_init( $controllers );
    671682        }
    672683
Note: See TracChangeset for help on using the changeset viewer.