← All changes
|
backend/src/Data/Transformers/AttachmentTransformer.php
+3
-3
0.3.1
→
1.5.5.1
View file →
| @@ -44,15 +44,15 @@ | ||
| 44 | 44 | 'url' => $meta['url'], |
| 45 | 45 | 'urls' => [ |
| 46 | 46 | 'medium' => $size ? $size[0] : null, |
| 47 | 47 | ], |
| 48 | - 'height' => $meta['height'], | |
| 49 | - 'width' => $meta['width'], | |
| 48 | + 'height' => isset( $meta['height'] ) ? $meta['height'] : null, | |
| 49 | + 'width' => isset( $meta['width'] ) ? $meta['width'] : null, | |
| 50 | 50 | 'orientation' => isset( $meta['orientation'] ) ? $meta['orientation'] : null, |
| 51 | 51 | ]; |
| 52 | 52 | |
| 53 | 53 | // Labels |
| 54 | - $labels = $this->notations->get_labels( 'post', $attachment->ID ); | |
| 54 | + $labels = $this->notations->get_labels( 'attachment', $attachment->ID ); | |
| 55 | 55 | foreach ( $labels as $label ) { |
| 56 | 56 | $response['labels'][] = $label['label_id']; |
| 57 | 57 | } |
| 58 | 58 | |