[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core component classes.

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

Defines 1 class

BP_Embed:: (3 methods):
  __construct()
  shortcode()
  parse_oembed()


Class: BP_Embed  - X-Ref

Enable oEmbeds in BuddyPress contexts.

Extends WP_Embed class for use with BuddyPress.

__construct()   X-Ref
Constructor


shortcode( $attr, $url = '' )   X-Ref
The {@link do_shortcode()} callback function.

Attempts to convert a URL into embed HTML. Starts by checking the
URL against the regex of the registered embed handlers. Next, checks
the URL against the regex of registered {@link WP_oEmbed} providers
if oEmbed discovery is false. If none of the regex matches and it's
enabled, then the URL will be passed to {@link BP_Embed::parse_oembed()}
for oEmbed parsing.


param: array  $attr Shortcode attributes.
param: string $url  The URL attempting to be embeded.
return: string The embed HTML on success, otherwise the original URL.

parse_oembed( $id, $url, $attr, $rawattr )   X-Ref
Base function so BP components/plugins can parse links to be embedded.

View an example to add support in {@link bp_activity_embed()}.

on success.
oEmbed failure.

param: int    $id      ID to do the caching for.
param: string $url     The URL attempting to be embedded.
param: array  $attr    Shortcode attributes from {@link WP_Embed::shortcode()}.
param: array  $rawattr Untouched shortcode attributes from
return: string The embed HTML on success, otherwise the original URL.



Generated: Sun Apr 28 01:01:05 2024 Cross-referenced by PHPXref 0.7.1