updated plugin ActivityPub version 5.8.0

This commit is contained in:
2025-04-29 21:19:06 +00:00
committed by Gitium
parent 19dfd317cc
commit fdfbf76539
166 changed files with 14119 additions and 7163 deletions

View File

@ -24,11 +24,11 @@ class Attachment extends Post {
* @return array The Attachments.
*/
protected function get_attachment() {
$mime_type = get_post_mime_type( $this->wp_object->ID );
$media_type = preg_replace( '/(\/[a-zA-Z]+)/i', '', $mime_type );
$type = '';
$mime_type = \get_post_mime_type( $this->item->ID );
$mime_type_parts = \explode( '/', $mime_type );
$type = '';
switch ( $media_type ) {
switch ( $mime_type_parts[0] ) {
case 'audio':
case 'video':
$type = 'Document';
@ -40,11 +40,11 @@ class Attachment extends Post {
$attachment = array(
'type' => $type,
'url' => wp_get_attachment_url( $this->wp_object->ID ),
'url' => wp_get_attachment_url( $this->item->ID ),
'mediaType' => $mime_type,
);
$alt = \get_post_meta( $this->wp_object->ID, '_wp_attachment_image_alt', true );
$alt = \get_post_meta( $this->item->ID, '_wp_attachment_image_alt', true );
if ( $alt ) {
$attachment['name'] = $alt;
}