Changeset 12607
- Timestamp:
- 03/31/2020 11:33:35 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r12587 r12607 357 357 parent::setup_cache_groups(); 358 358 } 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 } 359 382 } -
trunk/src/bp-friends/classes/class-bp-friends-component.php
r12589 r12607 326 326 parent::setup_cache_groups(); 327 327 } 328 329 /** 330 * Init the BP REST API. 331 * 332 * @since 6.0.0 333 * 334 * @param array $controllers Optional. See BP_Component::rest_api_init() for 335 * description. 336 */ 337 public function rest_api_init( $controllers = array() ) { 338 parent::rest_api_init( array( 'BP_REST_Friends_Endpoint' ) ); 339 } 328 340 } -
trunk/src/bp-groups/classes/class-bp-groups-component.php
r12590 r12607 937 937 * 938 938 * @since 5.0.0 939 * @since 6.0.0 Adds the Group Cover REST endpoint. 939 940 * 940 941 * @param array $controllers Optional. See BP_Component::rest_api_init() for … … 942 943 */ 943 944 public function rest_api_init( $controllers = array() ) { 944 parent::rest_api_init(array(945 $controllers = array( 945 946 'BP_REST_Groups_Endpoint', 946 947 'BP_REST_Group_Membership_Endpoint', … … 948 949 'BP_REST_Group_Membership_Request_Endpoint', 949 950 'BP_REST_Attachments_Group_Avatar_Endpoint', 950 ) ); 951 ); 952 953 // Support to Group Cover. 954 if ( bp_is_active( 'groups', 'cover_image' ) ) { 955 $controllers[] = 'BP_REST_Attachments_Group_Cover_Endpoint'; 956 } 957 958 parent::rest_api_init( $controllers ); 951 959 } 952 960 -
trunk/src/bp-members/classes/class-bp-members-component.php
r12579 r12607 655 655 * 656 656 * @since 5.0.0 657 * @since 6.0.0 Adds the Member Cover and Signup REST endpoints. 657 658 * 658 659 * @param array $controllers Optional. See BP_Component::rest_api_init() for … … 660 661 */ 661 662 public function rest_api_init( $controllers = array() ) { 662 parent::rest_api_init(array(663 $controllers = array( 663 664 /** 664 665 * As the Members component is always loaded, … … 668 669 'BP_REST_Members_Endpoint', 669 670 '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 ); 671 682 } 672 683 -
trunk/src/class-buddypress.php
r12578 r12607 551 551 'BP_REST_Activity_Endpoint' => 'activity', 552 552 553 'BP_Admin' => 'core', 554 'BP_Attachment_Avatar' => 'core', 555 'BP_Attachment_Cover_Image' => 'core', 556 'BP_Attachment' => 'core', 557 'BP_Button' => 'core', 558 'BP_Block' => 'core', 559 'BP_Component' => 'core', 560 'BP_Customizer_Control_Range' => 'core', 561 'BP_Date_Query' => 'core', 562 'BP_Email_Delivery' => 'core', 563 'BP_Email_Address' => 'core', 564 'BP_Email_Recipient' => 'core', 565 'BP_Email_Sender' => 'core', 566 'BP_Email_Participant' => 'core', 567 'BP_Email' => 'core', 568 'BP_Embed' => 'core', 569 'BP_Media_Extractor' => 'core', 570 'BP_Members_Suggestions' => 'core', 571 'BP_PHPMailer' => 'core', 572 'BP_Recursive_Query' => 'core', 573 'BP_Suggestions' => 'core', 574 'BP_Theme_Compat' => 'core', 575 'BP_User_Query' => 'core', 576 'BP_Walker_Category_Checklist' => 'core', 577 'BP_Walker_Nav_Menu_Checklist' => 'core', 578 'BP_Walker_Nav_Menu' => 'core', 579 'BP_Invitation_Manager' => 'core', 580 'BP_Invitation' => 'core', 581 'BP_REST_Components_Endpoint' => 'core', 582 'BP_REST_Attachments' => 'core', 583 'BP_REST_Attachments_Member_Avatar_Endpoint' => 'core', 584 'BP_REST_Attachments_Group_Avatar_Endpoint' => 'core', 585 586 'BP_Core_Friends_Widget' => 'friends', 553 'BP_REST_Blogs_Endpoint' => 'blogs', 554 'BP_REST_Attachments_Blog_Avatar_Endpoint' => 'blogs', 555 556 'BP_Admin' => 'core', 557 'BP_Attachment_Avatar' => 'core', 558 'BP_Attachment_Cover_Image' => 'core', 559 'BP_Attachment' => 'core', 560 'BP_Button' => 'core', 561 'BP_Block' => 'core', 562 'BP_Component' => 'core', 563 'BP_Customizer_Control_Range' => 'core', 564 'BP_Date_Query' => 'core', 565 'BP_Email_Delivery' => 'core', 566 'BP_Email_Address' => 'core', 567 'BP_Email_Recipient' => 'core', 568 'BP_Email_Sender' => 'core', 569 'BP_Email_Participant' => 'core', 570 'BP_Email' => 'core', 571 'BP_Embed' => 'core', 572 'BP_Media_Extractor' => 'core', 573 'BP_Members_Suggestions' => 'core', 574 'BP_PHPMailer' => 'core', 575 'BP_Recursive_Query' => 'core', 576 'BP_Suggestions' => 'core', 577 'BP_Theme_Compat' => 'core', 578 'BP_User_Query' => 'core', 579 'BP_Walker_Category_Checklist' => 'core', 580 'BP_Walker_Nav_Menu_Checklist' => 'core', 581 'BP_Walker_Nav_Menu' => 'core', 582 'BP_Invitation_Manager' => 'core', 583 'BP_Invitation' => 'core', 584 'BP_REST_Components_Endpoint' => 'core', 585 'BP_REST_Attachments' => 'core', 586 587 'BP_Core_Friends_Widget' => 'friends', 588 'BP_REST_Friends_Endpoint' => 'friends', 587 589 588 590 'BP_Group_Extension' => 'groups', … … 592 594 'BP_REST_Group_Invites_Endpoint' => 'groups', 593 595 'BP_REST_Group_Membership_Request_Endpoint' => 'groups', 594 595 'BP_Core_Members_Template' => 'members', 596 'BP_Core_Members_Widget' => 'members', 597 'BP_Core_Recently_Active_Widget' => 'members', 598 'BP_Core_Whos_Online_Widget' => 'members', 599 'BP_Registration_Theme_Compat' => 'members', 600 'BP_Signup' => 'members', 601 'BP_REST_Members_Endpoint' => 'members', 596 'BP_REST_Attachments_Group_Avatar_Endpoint' => 'groups', 597 'BP_REST_Attachments_Group_Cover_Endpoint' => 'groups', 598 599 'BP_Core_Members_Template' => 'members', 600 'BP_Core_Members_Widget' => 'members', 601 'BP_Core_Recently_Active_Widget' => 'members', 602 'BP_Core_Whos_Online_Widget' => 'members', 603 'BP_Registration_Theme_Compat' => 'members', 604 'BP_Signup' => 'members', 605 'BP_REST_Members_Endpoint' => 'members', 606 'BP_REST_Attachments_Member_Avatar_Endpoint' => 'members', 607 'BP_REST_Attachments_Member_Cover_Endpoint' => 'members', 608 'BP_REST_Signup_Endpoint' => 'members', 602 609 603 610 'BP_REST_Messages_Endpoint' => 'messages', -
trunk/tests/phpunit/assets/bp-rest-api-controllers.php
r12485 r12607 9 9 public function register_routes( $controller = '' ) { 10 10 array_push( buddypress()->unit_test_rest->controllers, $controller ); 11 } 12 } 13 14 /** 15 * BP Member Cover Image REST Controller's mock. 16 */ 17 class BP_REST_Attachments_Member_Cover_Endpoint extends BP_REST_Mock_Class { 18 public function __construct() { 19 $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); 20 $this->rest_base = 'members'; 21 } 22 23 public function register_routes( $controller = '' ) { 24 parent::register_routes( 'BP_REST_Attachments_Member_Cover_Endpoint' ); 11 25 } 12 26 } -
trunk/tests/phpunit/testcases/core/class-bp-component.php
r12559 r12607 34 34 'BP_REST_Members_Endpoint', 35 35 'BP_REST_Attachments_Member_Avatar_Endpoint', 36 'BP_REST_Attachments_Member_Cover_Endpoint', 36 37 ) ); 37 38 } … … 50 51 'BP_REST_Components_Endpoint', 51 52 'BP_REST_Attachments_Member_Avatar_Endpoint', 53 'BP_REST_Attachments_Member_Cover_Endpoint', 52 54 ) ); 53 55 } … … 67 69 'BP_REST_Members_Endpoint', 68 70 'BP_REST_Attachments_Member_Avatar_Endpoint', 71 'BP_REST_Attachments_Member_Cover_Endpoint', 69 72 ) ); 70 73 }
Note: See TracChangeset
for help on using the changeset viewer.