[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core component classes.

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

Defines 1 class

BP_Media_Extractor:: (11 methods):
  extract()
  extract_links()
  extract_mentions()
  extract_images()
  extract_shortcodes()
  extract_embeds()
  extract_audio()
  extract_video()
  extract_images_from_galleries()
  extract_images_from_featured_images()
  strip_markup()


Class: BP_Media_Extractor  - X-Ref

Extracts media from text. Use {@link extract()}.

extract( $richtext, $what_to_extract = self::ALL, $extra_args = array()   X-Ref
Extract media from text.

param: string|WP_Post $richtext        Content to parse.
param: int            $what_to_extract Media type to extract (optional).
param: array          $extra_args      Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_links( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract `<a href>` tags from text.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_mentions( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract @mentions tags from text.

If the Activity component is enabled, it is used to parse @mentions.
The mentioned "name" must match a user account, otherwise it is discarded.

If the Activity component is disabled, any @mentions are extracted.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor.
since: 2.3.0
return: array {

extract_images( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract images from `<img src>` tags, [galleries], and featured images from a Post.

If an image is in the Media Library, then its resolution is included in the results.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_shortcodes( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract shortcodes from text.

This includes any shortcodes indirectly used by other media extraction types.
For example, [gallery] and [audio].

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_embeds( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract any URL, matching a registered oEmbed endpoint, from text.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_audio( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract [audio] shortcodes and `<a href="*.mp3">` tags, from text.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_video( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract [video] shortcodes from text.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array {

extract_images_from_galleries( $richtext, $plaintext, $extra_args = array()   X-Ref
Extract images in [galleries] shortcodes from text.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Bespoke data for a particular extractor (optional).
since: 2.3.0
return: array

extract_images_from_featured_images( $richtext, $plaintext, $extra_args )   X-Ref
Extract the featured image from a Post.

param: string $richtext   Content to parse.
param: string $plaintext  Sanitized version of the content.
param: array  $extra_args Contains data that an implementation might need beyond the defaults.
since: 2.3.0
return: array

strip_markup( $richtext )   X-Ref
Sanitize and format raw content to prepare for content extraction.

HTML tags and shortcodes are removed, and HTML entities are decoded.

param: string $richtext Content to sanitize.
since: 2.3.0
return: string



Generated: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1