construct_info_retrieval_error( $request, $response ); } else { $doc = new DOMDocument(); @$doc->loadHTML( $response['body'] ); $metas = $doc->getElementsByTagName( 'meta' ); for ( $i = 0; $i < $metas->length; $i++ ) { $meta = $metas->item( $i ); if ( $meta->getAttribute( 'property' ) == 'og:image' ) { $result = $meta->getAttribute( 'content' ); break; } } } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => '', 'expected' => 'https://v.cdn.vine.co/v/thumbs/D6DDE013-F8DA-4929-9BED-49568F424343-184-00000008A20C1AEC_1.0.6.mp4.jpg', 'expected_hash' => '7cca5921108abe15b8c1c1f884a5b3ac', 'name' => __( 'iFrame Embed/Video URL', 'video-thumbnails' ) ), ); } } ?>