diff --git a/includes/transformer/class-post.php b/includes/transformer/class-post.php index cc7777d..480e7da 100644 --- a/includes/transformer/class-post.php +++ b/includes/transformer/class-post.php @@ -107,6 +107,32 @@ class Post extends Base { return $object_type; } + /** + * Gets the template to use to generate the content of the activitypub item. + * + * @return string The Template. + */ + protected function get_post_content_template() { + $type = \get_option( 'activitypub_post_content_type', 'content' ); + + switch ( $type ) { + case 'excerpt': + $template = "[ap_excerpt]\n\n[ap_permalink type=\"html\"]"; + break; + case 'title': + $template = "[ap_title]\n\n[ap_permalink type=\"html\"]"; + break; + case 'content': + $template = "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]"; + break; + default: + $template = \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ); + break; + } + + return apply_filters( 'activitypub_object_content_template', $template, $this->wp_post ); + } + /** * Transforms the WP_Post object to an ActivityPub Object *