diff --git a/includes/class-admin.php b/includes/class-admin.php index fbdf85dc..866f873d 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -56,10 +56,10 @@ class Admin { \register_setting( 'activitypub', 'activitypub_post_content_type', array( 'type' => 'string', - 'description' => \__( 'Use summary or full content', 'activitypub' ), + 'description' => \__( 'Use title and link, summary or full content', 'activitypub' ), 'show_in_rest' => array( 'schema' => array( - 'enum' => array( 'excerpt', 'content' ), + 'enum' => array( 'title', 'excerpt', 'content' ), ), ), 'default' => 'content', diff --git a/includes/model/class-post.php b/includes/model/class-post.php index f27e3d15..738ab17d 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -204,6 +204,10 @@ class Post { return $this->get_the_post_summary(); } + if ( 'title' === \get_option( 'activitypub_post_content_type', 'content' ) ) { + return $this->get_the_title(); + } + return $this->get_the_post_content(); } diff --git a/templates/settings.php b/templates/settings.php index e4e95325..3949e4f6 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -17,7 +17,10 @@ -

+

+ - +

+

-