Method | Description | |
---|---|---|
build_image_struct ( $image_list ) | ||
extract ( $blog_id, $post_id, $what_to_extract = self::ALL ) | Gets the specified media and meta info from the given post. | |
extract_from_content ( $content, $what_to_extract = self::ALL, $already_extracted = [] ) | Gets the specified meta info from the given post content. | |
extract_images_from_content ( $content, $image_list ) | ||
get_images_from_html ( string $html, array $images_already_extracted ) : array |
Method | Description | |
---|---|---|
get_image_fields ( $post, $args = [] ) | ||
get_stripped_content ( $content ) |
public static extract ( $blog_id, $post_id, $what_to_extract = self::ALL ) | ||
$blog_id | The ID of the blog | |
$post_id | The ID of the post | |
$what_to_extract | (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS |
public static extract_from_content ( $content, $what_to_extract = self::ALL, $already_extracted = [] ) | ||
$content | The HTML post_content of a post | |
$what_to_extract | (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS | |
$already_extracted | (array) Previously extracted things, e.g. images from extract(), which can be used for x-referencing here |
public static extract_images_from_content ( $content, $image_list ) |
public static get_images_from_html ( string $html, array $images_already_extracted ) : array | ||
$html | string | Some markup, possibly containing image tags |
$images_already_extracted | array | (just an array of image URLs without query strings, no special structure), used for de-duplication |
return | array | Image URLs extracted from the HTML, stripped of query params and de-duped |