Use the "summary" property for a title as Mastodon does.

This commit is contained in:
Ben Lubar 2020-01-18 12:38:08 -06:00
parent 85db6f2d7e
commit b4a79fd57e
No known key found for this signature in database
GPG key ID: 92939677AB59EDA4

View file

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