- 
                Notifications
    
You must be signed in to change notification settings  - Fork 83
 
activitypub_attachment_ids
        github-actions[bot] edited this page Sep 22, 2025 
        ·
        14 revisions
      
    Filter the attachment IDs for a post.
/**
 * Filter the attachment IDs for a post.
 *
 * @param array   $media 
 * @param WP_Post $item 
 * @return array The filtered attachment IDs.
 */
function my_activitypub_attachment_ids_callback( array $media, WP_Post $item ) {
    // Your code here.
    return $media;
}
add_filter( 'activitypub_attachment_ids', 'my_activitypub_attachment_ids_callback', 10, 2 );- 
array$mediaThe media array grouped by type. - 
WP_Post$itemThe post object. 
array The filtered attachment IDs.
\apply_filters( 'activitypub_attachment_ids', $media, $this->item )Follow @activitypub.blog@activitypub.blog for updates and news.