Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/27/2024 09:11:27 PM (8 months ago)
Author:
espellcaste
Message:

Include the V2 of the BP REST API in BuddyPress core.

We are officially deprecating the V1 of the BP REST API. And bundling the new, default, V2 of the BP REST API inside BuddyPress core. Previously, the V1 was developed as a plugin in a separate repo (https://github.com/buddypress/BP-REST).

  • One of the main differences between the V1 and V2 is how objects are returned. Single items are no longer returned as an array;
  • We have a new BP_Test_REST_Controller_Testcase for testing the new API endpoints;
  • We changed the names of our controllers to follow our autoloader rules;
  • Removed the BP-REST plugin from wp-env and from our release script;
  • And we added notices for the deprecated V1 API (endpoints and files).

Props imath & I. ;)

Fixes #8200
See #9145
Closes https://github.com/buddypress/buddypress/pull/337

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r14013 r14026  
    50075007    /*
    50085008     * If the constant is not defined, put our logic in place so that only the
    5009      * 2 last versions deprecated functions will be loaded for upgraded installs.
     5009     * 2 last versions deprecated functions will be loaded for upgraded installations.
    50105010     */
    50115011    $initial_version        = (float) bp_get_initial_version();
     
    50135013    $load_latest_deprecated = $initial_version < $current_major_version;
    50145014
    5015     // New installs.
     5015    // New installations.
    50165016    if ( ! $load_latest_deprecated ) {
    50175017        // Run some additional checks if PHPUnit is running.
     
    50195019            $deprecated_files = array_filter(
    50205020                array_map(
    5021                     function( $file ) {
    5022                         if ( false !== strpos( $file, '.php' ) ) {
     5021                    function ( $file ) {
     5022                        if ( str_contains( $file, '.php' ) ) {
    50235023                            return (float) str_replace( '.php', '', $file );
    5024                         };
     5024                        }
     5025
     5026                        return null;
    50255027                    },
    50265028                    scandir( buddypress()->plugin_dir . 'bp-core/deprecated' )
Note: See TracChangeset for help on using the changeset viewer.