[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-core-oembed-extension.php (summary)

Core component classes.

File Size: 628 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 20 functions

  __construct()
  set_route_args()
  set_iframe_title()
  custom_hooks()
  set_permalink()
  get_item_id()
  setup_properties()
  setup_hooks()
  register_route()
  setup_template_parts()
  content_buffer_start()
  content_buffer_end()
  add_oembed_discovery_links()
  get_oembed_response_data()
  get_item()
  oembed_xml_request()
  filter_embed_url()
  filter_embed_html()
  filter_rest_url()
  inject_content()

Functions
Functions that are not part of a class:

__construct()   X-Ref
Constructor.


set_route_args()   X-Ref
If your oEmbed endpoint requires additional arguments, set them here.

return: array
since: 2.6.0

set_iframe_title( $item_id )   X-Ref
Set the iframe title.

If not set, this will fallback to WP's 'Embedded WordPress Post'.

param: int $item_id The item ID to do checks for.
since: 2.6.0

custom_hooks()   X-Ref
Do what you need to do here to initialize any custom hooks.

since: 2.6.0

set_permalink()   X-Ref
Set permalink for oEmbed link discovery.

This method will be called on the page we want to oEmbed.  In most cases,
you will not need to override this method.  However, if you need to, do
override in your extended class.

since: 2.6.0

get_item_id()   X-Ref
Get the item ID when filtering the oEmbed HTML.

Should only be used during the 'embed_html' hook.

since: 2.6.0

setup_properties()   X-Ref
Set up properties.

since: 2.6.0

setup_hooks()   X-Ref
Hooks! We do the dirty work here, so you don't have to! :)

More hooks are available in the setup_template_parts() method.

since: 2.6.0

register_route()   X-Ref
Register the oEmbed REST API route.

since: 2.6.0

setup_template_parts( $template )   X-Ref
Set up custom embed template parts for BuddyPress use.

return: string
param: string $template File path to current embed template.
since: 2.6.0

content_buffer_start( $slug, $name )   X-Ref
Start object buffer.

We're going to override WP's get_template_part( 'embed, 'content' ) call
and inject our own template for BuddyPress use.

param: string $slug Template slug.
param: string $name Template name.
since: 2.6.0

content_buffer_end( $name )   X-Ref
End object buffer.

We're going to override WP's get_template_part( 'embed, 'content' ) call
and inject our own template for BuddyPress use.

param: string $name Template name.
since: 2.6.0

add_oembed_discovery_links( $retval )   X-Ref
Adds oEmbed discovery links on single activity pages.

return: string
param: string $retval Current discovery links.
since: 2.6.0

get_oembed_response_data( $item, $width )   X-Ref
Fetch our oEmbed response data to return.

A simplified version of {@link get_oembed_response_data()}.

return: array
param: array $item  Custom oEmbed response data.
param: int   $width The requested width.
since: 2.6.0

get_item( $request )   X-Ref
Callback for the API endpoint.

Returns the JSON object for the item.

return: WP_Error|array oEmbed response data or WP_Error on failure.
param: WP_REST_Request $request Full data about the request.
since: 2.6.0

oembed_xml_request( $served, $result, $request, $server )   X-Ref
If oEmbed request wants XML, return XML instead of JSON.

Basically a copy of {@link _oembed_rest_pre_serve_request()}. Unfortunate
that we have to duplicate this just for a URL check.

return: bool
param: bool                      $served  Whether the request has already been served.
param: WP_HTTP_ResponseInterface $result  Result to send to the client. Usually a WP_REST_Response.
param: WP_REST_Request           $request Request used to generate the response.
param: WP_REST_Server            $server  Server instance.
since: 2.6.0

filter_embed_url( $retval )   X-Ref
Pass our BuddyPress activity permalink for embedding.

return: string
param: string $retval Current embed URL.
since: 2.6.0

filter_embed_html( $retval )   X-Ref
Filters the embed HTML for our BP oEmbed endpoint.

return: string
param: string $retval Current embed HTML.
since: 2.6.0

filter_rest_url( $retval = '' )   X-Ref
Append our custom slug endpoint to oEmbed endpoint URL.

Meant to be used as a filter on 'rest_url' before any call to
{@link get_oembed_endpoint_url()} is used.

return: string
param: string $retval Current oEmbed endpoint URL.
since: 2.6.0

inject_content()   X-Ref
Inject content into the embed template.

since: 2.6.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1