ALL
ALL
Class with methods to extract metadata from a post/page about videos, images, links, mentions embedded in or attached to the post/page.
extract(mixed $blog_id, mixed $post_id, mixed $what_to_extract)
Gets the specified media and meta info from the given post.
NOTE: If you have the post's HTML content already and don't need image data, use extract_from_content() instead.
mixed | $blog_id | The ID of the blog |
mixed | $post_id | The ID of the post |
mixed | $what_to_extract | (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS |
extract_from_content(mixed $content, mixed $what_to_extract, mixed $already_extracted)
Gets the specified meta info from the given post content.
NOTE: If you want IMAGES, call extract( $blog_id, $post_id, ...) which will give you more/better image extraction This method will give you an error if you ask for IMAGES.
mixed | $content | The HTML post_content of a post |
mixed | $what_to_extract | (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS |
mixed | $already_extracted | (array) Previously extracted things, e.g. images from extract(), which can be used for x-referencing here |
get_images_from_html(string $html, array $images_already_extracted) : array
string | $html | Some markup, possibly containing image tags |
array | $images_already_extracted | (just an array of image URLs without query strings, no special structure), used for de-duplication |
Image URLs extracted from the HTML, stripped of query params and de-duped