-
Notifications
You must be signed in to change notification settings - Fork 9
mastodon_api_media_attachment
github-actions[bot] edited this page Jul 24, 2026
·
32 revisions
Filters the media attachment returned by the API.
add_filter(
'mastodon_api_media_attachment',
function (
array $media_attachment,
int $attachment_id
) {
// Your code here
return $media_attachment;
},
10,
2
);-
array$media_attachmentThe media attachment. -
int$attachment_idThe attachment ID.
Enable_Mastodon_Apps\Entity\Media_Attachment The media attachment.
apply_filters( 'mastodon_api_media_attachment', null, $attachment_id )apply_filters( 'mastodon_api_media_attachment', null, $media_id )