diff --git src/bp-groups/classes/class-bp-groups-component.php src/bp-groups/classes/class-bp-groups-component.php
index b53835ea0..609f9c657 100644
|
|
class BP_Groups_Component extends BP_Component { |
932 | 932 | * description. |
933 | 933 | */ |
934 | 934 | public function rest_api_init( $controllers = array() ) { |
935 | | parent::rest_api_init( array( |
| 935 | $controllers = array( |
936 | 936 | 'BP_REST_Groups_Endpoint', |
937 | 937 | 'BP_REST_Group_Membership_Endpoint', |
938 | 938 | 'BP_REST_Group_Invites_Endpoint', |
939 | 939 | 'BP_REST_Group_Membership_Request_Endpoint', |
940 | | 'BP_REST_Attachments_Group_Avatar_Endpoint', |
941 | | ) ); |
| 940 | ); |
| 941 | |
| 942 | // Only Load the Group's Avatar controller if Group Avatar uploads are allowed. |
| 943 | if ( ! bp_disable_group_avatar_uploads() ) { |
| 944 | $controllers[] = 'BP_REST_Attachments_Group_Avatar_Endpoint'; |
| 945 | } |
| 946 | |
| 947 | parent::rest_api_init( $controllers ); |
942 | 948 | } |
943 | 949 | } |
diff --git src/bp-members/classes/class-bp-members-component.php src/bp-members/classes/class-bp-members-component.php
index a83344feb..73b63348b 100644
|
|
class BP_Members_Component extends BP_Component { |
473 | 473 | */ |
474 | 474 | 'BP_REST_Components_Endpoint', |
475 | 475 | 'BP_REST_Members_Endpoint', |
476 | | 'BP_REST_Attachments_Member_Avatar_Endpoint', |
477 | 476 | ) ); |
478 | 477 | } |
479 | 478 | } |
diff --git src/bp-xprofile/classes/class-bp-xprofile-component.php src/bp-xprofile/classes/class-bp-xprofile-component.php
index b43879d34..e2133287d 100644
|
|
class BP_XProfile_Component extends BP_Component { |
499 | 499 | * description. |
500 | 500 | */ |
501 | 501 | public function rest_api_init( $controllers = array() ) { |
502 | | parent::rest_api_init( array( |
| 502 | $controllers = array( |
503 | 503 | 'BP_REST_XProfile_Fields_Endpoint', |
504 | 504 | 'BP_REST_XProfile_Field_Groups_Endpoint', |
505 | 505 | 'BP_REST_XProfile_Data_Endpoint', |
506 | | ) ); |
| 506 | ); |
| 507 | |
| 508 | // Only Load the Member's Avatar controller if Avatar uploads are allowed. |
| 509 | if ( ! bp_disable_avatar_uploads() ) { |
| 510 | $controllers[] = 'BP_REST_Attachments_Member_Avatar_Endpoint'; |
| 511 | } |
| 512 | |
| 513 | parent::rest_api_init( $controllers ); |
507 | 514 | } |
508 | 515 | } |