Skip to content

activitypub_object_content_template

github-actions[bot] edited this page Nov 6, 2025 · 17 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.

Auto-generated Example

/**
 * 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 
 * @param string  $type 
 * @return string The filtered value.
 */
function my_activitypub_object_content_template_callback( string $template, WP_Post $item, string $type ) {
    // Your code here.
    return $template;
}
add_filter( 'activitypub_object_content_template', 'my_activitypub_object_content_template_callback', 10, 3 );

Parameters

  • string $template The template string containing shortcodes.
  • WP_Post $item The WordPress post object being transformed.
  • string $type ActivityStreams 2.0 Object-Type for the post.

Files

apply_filters( 'activitypub_object_content_template', $template, $this->item, $type )

← All Hooks

Users

Developers

Clone this wiki locally