Jetpack_Media_Meta_Extractor::get_image_fields PHP Method

get_image_fields() private static method

private static get_image_fields ( $post, $args = [] )
$post A post object
$args (array) Optional args, see defaults list for details
    private static function get_image_fields($post, $args = array())
    {
        $defaults = array('width' => 200, 'height' => 200);
        $args = wp_parse_args($args, $defaults);
        $image_list = array();
        $image_booleans = array();
        $image_booleans['gallery'] = 0;
        $from_featured_image = Jetpack_PostImages::from_thumbnail($post->ID, $args['width'], $args['height']);
        if (!empty($from_featured_image)) {
            $srcs = wp_list_pluck($from_featured_image, 'src');
            $image_list = array_merge($image_list, $srcs);
        }
        $from_slideshow = Jetpack_PostImages::from_slideshow($post->ID, $args['width'], $args['height']);
        if (!empty($from_slideshow)) {
            $srcs = wp_list_pluck($from_slideshow, 'src');
            $image_list = array_merge($image_list, $srcs);
        }
        $from_gallery = Jetpack_PostImages::from_gallery($post->ID);
        if (!empty($from_gallery)) {
            $srcs = wp_list_pluck($from_gallery, 'src');
            $image_list = array_merge($image_list, $srcs);
            $image_booleans['gallery']++;
            // @todo This count isn't correct, will only every count 1
        }
        // @todo Can we check width/height of these efficiently?  Could maybe use query args at least, before we strip them out
        $image_list = Jetpack_Media_Meta_Extractor::get_images_from_html($post->post_content, $image_list);
        return Jetpack_Media_Meta_Extractor::build_image_struct($image_list);
    }