-
Notifications
You must be signed in to change notification settings - Fork 85
activitypub_object_content_template
github-actions[bot] edited this page Oct 2, 2025
·
16 revisions
Filters the template used to generate ActivityPub object content.
This filter allows developers to modify the template that determines how post content is formatted in ActivityPub objects. The template can include special shortcodes like [ap_title] and [ap_content] that are processed during content generation.
/**
* Filters the template used to generate ActivityPub object content.
*
* This filter allows developers to modify the template that determines how post
* content is formatted in ActivityPub objects. The template can include special
* shortcodes like [ap_title] and [ap_content] that are processed during content
* generation.
*
* @param string $template
* @param WP_Post $item
* @return string The filtered value.
*/
function my_activitypub_object_content_template_callback( string $template, WP_Post $item ) {
// Your code here.
return $template;
}
add_filter( 'activitypub_object_content_template', 'my_activitypub_object_content_template_callback', 10, 2 );
-
string
$template
The template string containing shortcodes. -
WP_Post
$item
The WordPress post object being transformed.
apply_filters( 'activitypub_object_content_template', $template, $this->item )
Follow @[email protected] for updates and news.