-
Notifications
You must be signed in to change notification settings - Fork 86
activitypub_post_object_type
github-actions[bot] edited this page Apr 22, 2026
·
1 revision
Filters the ActivityPub object type for a post.
Allows downstream consumers to override the discriminator that decides whether a post federates as Note, Article, or Page. The filtered value propagates to all internal callers of get_type(), including former_type/tombstone handling, summary and title decisions, the content template, and the preview guard, not only the wire-format type property.
/**
* Filters the ActivityPub object type for a post.
*
* Allows downstream consumers to override the discriminator that
* decides whether a post federates as Note, Article, or Page.
* The filtered value propagates to all internal callers of
* get_type(), including former_type/tombstone handling,
* summary and title decisions, the content template, and the
* preview guard, not only the wire-format type property.
*
* @param string $object_type
* @param WP_Post $post
* @return string The filtered value.
*/
function my_activitypub_post_object_type_callback( string $object_type, WP_Post $post ) {
// Your code here.
return $object_type;
}
add_filter( 'activitypub_post_object_type', 'my_activitypub_post_object_type_callback', 10, 2 );-
string$object_typeThe computed ActivityPub object type. -
WP_Post$postThe WordPress post being transformed.
\apply_filters( 'activitypub_post_object_type', $object_type, $this->item )Follow @activitypub.blog@activitypub.blog for updates and news.