PluginProbe
ActivityPub / 5.7.0
ActivityPub v5.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/transformer/class-attachment.php +2 -8 9.2.0 → 5.7.0 View file →
@@ -15,12 +15,8 @@
15 15 *
16 16 * Currently supported are:
17 17 *
18 18 * - Activitypub\Activity\Base_Object
19 - *
20 - * Redaction is inherited from {@see Post::is_redacted()}: `is_post_publicly_queryable()`
21 - * already resolves an attachment's own visibility, password, post-type support, and — for
22 - * attached media — its parent's visibility, so no attachment-specific override is needed.
23 19 */
24 20 class Attachment extends Post {
25 21 /**
26 22 * Generates all Media Attachments for a Post.
@@ -33,12 +29,10 @@
33 29 $type = '';
34 30
35 31 switch ( $mime_type_parts[0] ) {
36 32 case 'audio':
37 - $type = 'Audio';
38 - break;
39 33 case 'video':
40 - $type = 'Video';
34 + $type = 'Document';
41 35 break;
42 36 case 'image':
43 37 $type = 'Image';
44 38 break;
@@ -45,9 +39,9 @@
45 39 }
46 40
47 41 $attachment = array(
48 42 'type' => $type,
49 - 'url' => \wp_get_attachment_url( $this->item->ID ),
43 + 'url' => wp_get_attachment_url( $this->item->ID ),
50 44 'mediaType' => $mime_type,
51 45 );
52 46
53 47 $alt = \get_post_meta( $this->item->ID, '_wp_attachment_image_alt', true );