Skip to:
Content

BuddyPress.org

Changeset 12685


Ignore:
Timestamp:
07/22/2020 10:43:29 AM (4 years ago)
Author:
imath
Message:

Activity: add a permission_callback to the BP Activity Embed route

Since version 5.5, WordPress is requiring REST routes to have a permission callback. As Activity Embeds are public content and can be seen by any user, we are using the __return_true function as the permission callback for the oembed/1.0/embed/activity route.

See #8334 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-oembed-extension.php

    r12281 r12685  
    231231        register_rest_route( 'oembed/1.0', "/embed/{$this->slug_endpoint}", array(
    232232            array(
    233                 'methods'  => WP_REST_Server::READABLE,
    234                 'callback' => array( $this, 'get_item' ),
    235                 'args'     => $args
     233                'methods'             => WP_REST_Server::READABLE,
     234                'callback'            => array( $this, 'get_item' ),
     235                'permission_callback' => '__return_true',
     236                'args'                => $args
    236237            ),
    237238        ) );
Note: See TracChangeset for help on using the changeset viewer.