Automattic/jetpack — pull request #1312 by xyu (2014-11-19 20:06:54+00:00)
Title: Related Posts: Allow filter by `post_format`

We have added `post_format` into the Elasticsearch index so we can how filter
by that for related posts. By default all post formats are returned however
there is now a `jetpack_relatedposts_filter_post_formats` that can be used like
so:

```php
// Only return image and gallery post formats
function jetpackme_related_post_only_images( $post_formats, $post_id ) {
$post_formats[] = 'image';
$post_formats[] = 'gallery';
return $post_formats;
}
add_filter(
'jetpack_relatedposts_filter_post_formats',
'jetpackme_related_post_only_images'
);
```

Resolves #287