-
Notifications
You must be signed in to change notification settings - Fork 82
activitypub_max_image_attachments
github-actions[bot] edited this page Aug 1, 2025
·
13 revisions
Filters the maximum number of media attachments allowed in a post.
Despite the name suggesting only images, this filter controls the maximum number of all media attachments (images, audio, and video) that can be included in an ActivityPub post. The name is maintained for backwards compatibility.
/**
* Filters the maximum number of media attachments allowed in a post.
*
* Despite the name suggesting only images, this filter controls the maximum number
* of all media attachments (images, audio, and video) that can be included in an
* ActivityPub post. The name is maintained for backwards compatibility.
*
* @param int $max_media
* @param WP_Comment $item
* @return int The filtered value.
*/
function my_activitypub_max_image_attachments_callback( int $max_media, WP_Comment $item = null ) {
// Your code here.
return $max_media;
}
add_filter( 'activitypub_max_image_attachments', 'my_activitypub_max_image_attachments_callback' );
-
int
$max_media
Maximum number of media attachments. Default ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS. -
WP_Comment
$item
The comment object.
\apply_filters( 'activitypub_max_image_attachments', $max_media, $this->item )
\apply_filters( 'activitypub_max_image_attachments', $max_media )
Follow @[email protected] for updates and news.