- 
                Notifications
    You must be signed in to change notification settings 
- Fork 84
activitypub_attachments_media_markup
        github-actions[bot] edited this page Oct 29, 2025 
        ·
        2 revisions
      
    Filters the media markup for ActivityPub attachments.
Allows plugins to provide custom markup for attachments. If this filter returns a non-empty string, it will be used instead of the default block markup.
/**
 * Filters the media markup for ActivityPub attachments.
 * 
 * Allows plugins to provide custom markup for attachments.
 * If this filter returns a non-empty string, it will be used instead of
 * the default block markup.
 *
 * @param string            $markup 
 * @param Activitypub\int[] $attachment_ids 
 * @return string The filtered value.
 */
function my_activitypub_attachments_media_markup_callback( string $markup, Activitypub\int[] $attachment_ids ) {
    // Your code here.
    return $markup;
}
add_filter( 'activitypub_attachments_media_markup', 'my_activitypub_attachments_media_markup_callback', 10, 2 );- 
string$markupThe custom markup. Default empty string.
- 
Activitypub\int[]$attachment_idsArray of attachment IDs.
\apply_filters( 'activitypub_attachments_media_markup', '', $attachment_ids )Follow @[email protected] for updates and news.