Skip to content

Commit

Permalink
Deprecate current clases in favor of V2 alternates
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Sep 23, 2024
1 parent 93680e9 commit d94abc6
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Activity_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->activity->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Blogs_Avatar_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->blogs->id;
$this->blogs_endpoint = new BP_REST_Blogs_Endpoint();
Expand Down
2 changes: 2 additions & 0 deletions includes/bp-blogs/classes/class-bp-rest-blogs-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Blogs_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->blogs->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Core_Components_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'components';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Friends_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->friends->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class BP_REST_Attachments_Group_Avatar_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Avatar_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id;
$this->groups_endpoint = new BP_REST_Groups_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class BP_REST_Attachments_Group_Cover_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Cover_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id;
$this->groups_endpoint = new BP_REST_Groups_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Invite_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id . '/invites';
$this->groups_endpoint = new BP_REST_Groups_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Membership_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id;
$this->groups_endpoint = new BP_REST_Groups_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Membership_Request_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id . '/membership-requests';
$this->groups_endpoint = new BP_REST_Groups_Endpoint();
Expand Down
2 changes: 2 additions & 0 deletions includes/bp-groups/classes/class-bp-rest-groups-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->groups->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class BP_REST_Attachments_Member_Avatar_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Avatar_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'members';
$this->avatar_instance = new BP_Attachment_Avatar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class BP_REST_Attachments_Member_Cover_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Cover_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'members';
$this->attachment_instance = new BP_Attachment_Cover_Image();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Members_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'members';
}
Expand Down
2 changes: 2 additions & 0 deletions includes/bp-members/classes/class-bp-rest-signup-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
* @since 6.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Signup_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'signup';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class BP_REST_Messages_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Messages_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->messages->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BP_REST_Sitewide_Notices_Endpoint extends WP_REST_Controller {
* @since 9.0.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Messages_Sitewide_Notices_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = 'sitewide-notices';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_Notifications_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->notifications->id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class BP_REST_XProfile_Data_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Data_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->profile->id;
$this->fields_endpoint = new BP_REST_XProfile_Fields_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class BP_REST_XProfile_Field_Groups_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Field_Groups_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->profile->id . '/groups';
$this->fields_endpoint = new BP_REST_XProfile_Fields_Endpoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class BP_REST_XProfile_Fields_Endpoint extends WP_REST_Controller {
* @since 0.1.0
*/
public function __construct() {
_deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Fields_REST_Controller' );

$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
$this->rest_base = buddypress()->profile->id . '/fields';
}
Expand Down

0 comments on commit d94abc6

Please sign in to comment.