from_slideshow()
from_slideshow( $post_id, $width, $height)
If a slideshow is embedded within a post, then parse out the images involved and return them
Parameters
$post_id | ||
$width | ||
$height |
Useful for finding an image to display alongside/in representation of a specific post.
Includes a few different methods, all of which return a similar-format array containing details of any images found. Everything can (should) be called statically, it's just a function-bucket. You can also call Jetpack_PostImages::get_image() to cycle through all of the methods until one of them finds something useful.
This file is included verbatim in Jetpack
from_thumbnail(int $post_id, $width, $height) : Array
Check if a Featured Image is set for this post, and return it in a similar format to the other images?_from_*() methods.
int | $post_id | The post ID to check |
$width | ||
$height |
containing details of the Featured Image, or empty array if none.
get_image(int $post_id, array $args) : Array
Run through the different methods that we have available to try to find a single good display image for this post.
int | $post_id | |
array | $args | Other arguments (currently width and height required for images where possible to determine) |
containing details of the best image to be used
get_images(int $post_id, array $args) : Array
Get an array containing a collection of possible images for this post, stopping once we hit a method that returns something useful.
int | $post_id | |
array | $args | Optional args, see defaults list for details |
containing images that would be good for representing this post