From b4a79fd57ed289e1ce0d61f47237b9107e4e163d Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sat, 18 Jan 2020 12:38:08 -0600 Subject: [PATCH] Use the "summary" property for a title as Mastodon does. --- includes/model/class-post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/model/class-post.php b/includes/model/class-post.php index 0b2b809..20e867f 100644 --- a/includes/model/class-post.php +++ b/includes/model/class-post.php @@ -37,7 +37,7 @@ class Post { 'type' => $this->get_object_type(), 'published' => \date( 'Y-m-d\TH:i:s\Z', \strtotime( $post->post_date ) ), 'attributedTo' => \get_author_posts_url( $post->post_author ), - 'summary' => $this->get_the_summary(), + 'summary' => $this->get_the_title(), 'inReplyTo' => null, 'content' => $this->get_the_content(), 'contentMap' => array( @@ -215,11 +215,11 @@ class Post { return $this->get_the_post_content(); } - public function get_the_summary() { + public function get_the_title() { if ( 'Article' === $this->get_object_type() ) { - $excerpt = $this->get_the_post_excerpt( 400 ); + $title = \get_the_title( $this->post ); - return \html_entity_decode( $excerpt, ENT_QUOTES, 'UTF-8' ); + return \html_entity_decode( $title, ENT_QUOTES, 'UTF-8' ); } return null;