voceconnect/thermal-api — pull request #87 by LuisHerranz (2014-03-06 10:39:00+00:00)
Title: add filter to $attachment_ids to be able to include more media ids

This way you can add things like these:

```
add_filter( 'thermal_attachment_ids', function($attachment_ids, &$post ) {
//get media in ACF images (look for 'imageid')
$custom_fields = get_post_custom( $post->ID );
foreach ( $custom_fields as $field_key => $field_values ) {
foreach ( $field_values as $key => $value ) {
if ( ( strpos($field_key, '_') !== 0 ) && ( strpos($field_key,'imageid') !== false ) ) {
array_push($attachment_ids, (int)$value);
}
}
}
// if it's an attachment, add its own ID so media gets populated
if ( $post->post_type === "attachment" ) {
array_push( $attachment_ids, $post->ID );
}
return $attachment_ids; }, 10, 2);
```