Skip to content

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.

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 
 * @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 );

Parameters

  • string $template The template string containing shortcodes.
  • WP_Post $item The WordPress post object being transformed.

Files

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

← All Hooks

Users

Developers

Clone this wiki locally