Merge branch 'dev/extendable-transformers' of ssh://code.event-federation.eu:2222/Event-Federation/wordpress-activitypub into dev/extendable-transformers
Some checks failed
PHP_CodeSniffer / phpcs (push) Failing after 4m39s
Unit Testing / phpunit (5.6, 6.2) (push) Failing after 4m38s
Unit Testing / phpunit (7.0) (push) Failing after 4m55s
Unit Testing / phpunit (7.2) (push) Failing after 5m4s
Unit Testing / phpunit (7.3) (push) Failing after 5m57s
Unit Testing / phpunit (7.4) (push) Failing after 5m28s
Unit Testing / phpunit (8.0) (push) Failing after 6m2s
Unit Testing / phpunit (8.1) (push) Failing after 5m53s
Unit Testing / phpunit (8.2) (push) Failing after 5m45s
Unit Testing / phpunit (latest) (push) Failing after 5m36s

This commit is contained in:
André Menrath 2023-12-12 17:10:54 +01:00
commit 6819366b85

View file

@ -107,6 +107,32 @@ class Post extends Base {
return $object_type; 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 * Transforms the WP_Post object to an ActivityPub Object
* *