Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | function thewire_image_get_attachments($post_guid) { |
||
13 | $post_guid = sanitise_int($post_guid); |
||
14 | if (!$post_guid) { |
||
15 | return false; |
||
16 | } |
||
17 | |||
18 | $attachments = elgg_get_entities_from_relationship(array( |
||
19 | 'relationship' => 'is_attachment', |
||
20 | 'relationship_guid' => $post_guid, |
||
21 | 'inverse_relationship' => true, |
||
22 | 'limit' => 1 |
||
23 | )); |
||
24 | |||
25 | if ($attachments) { |
||
26 | return $attachments[0]; |
||
27 | } |
||
28 | |||
29 | return false; |
||
30 | } |