Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/27/2024 09:11:27 PM (15 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-blogs/bp-blogs-template.php

    r13970 r14026  
    374374        $alt_attribute = __( 'Site icon for the blog', 'buddypress' );
    375375
    376         if ( ! $blogs_template && isset( $args['blog_id'] ) && $args['blog_id'] ) {
     376        $has_current_blog = isset( $blogs_template ) && isset( $blogs_template->blog->blog_id );
     377
     378        if ( false === $has_current_blog && isset( $args['blog_id'] ) && $args['blog_id'] ) {
    377379            $blog_id = (int) $args['blog_id'];
    378         } else {
     380        } else if ( true === $has_current_blog ) {
    379381            $blog_id = bp_get_blog_id();
    380382
    381383            /* translators: %s is the blog name */
    382384            $alt_attribute = sprintf( __( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() );
     385        } else {
     386            $blog_id = 0;
    383387        }
    384388
Note: See TracChangeset for help on using the changeset viewer.