BP_Core_oEmbed_Extension::add_oembed_discovery_links( string $retval )

Adds oEmbed discovery links on single activity pages.

Description

Parameters

$retval

(Required) Current discovery links.

Return

(string)

Source

File: bp-core/classes/class-bp-core-oembed-extension.php

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
public function add_oembed_discovery_links( $retval ) {
    if ( ! $this->is_page() ) {
        return $retval;
    }
 
    $permalink = $this->set_permalink();
    if ( empty( $permalink ) ) {
        return $retval;
    }
 
    add_filter( 'rest_url' , array( $this, 'filter_rest_url' ) );
 
    $retval = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( $permalink ) ) . '" />' . "\n";
 
    if ( class_exists( 'SimpleXMLElement' ) ) {
        $retval .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( $permalink, 'xml' ) ) . '" />' . "\n";
    }
 
    remove_filter( 'rest_url' , array( $this, 'filter_rest_url' ) );
 
    return $retval;
}

Changelog

Changelog
Version Description
BuddyPress 2.6.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.