-
Notifications
You must be signed in to change notification settings - Fork 80
activitypub_attachments
github-actions[bot] edited this page Aug 18, 2025
·
10 revisions
Filter the attachments for a post.
/**
* Filter the attachments for a post.
*
* @param array $attachments
* @param WP_Post $item
* @return array The filtered attachments.
*/
function my_activitypub_attachments_callback( array $attachments, WP_Post $item ) {
// Your code here.
return $attachments;
}
add_filter( 'activitypub_attachments', 'my_activitypub_attachments_callback', 10, 2 );
-
array
$attachments
The attachments. -
WP_Post
$item
The post object.
array
The filtered attachments.
\apply_filters( 'activitypub_attachments', $attachments, $this->item )
Follow @[email protected] for updates and news.