From 74511f77a5585495053635fe7c1aaa8992b09f2f Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 19 Oct 2018 06:09:40 -0400 Subject: [PATCH] Use get_the_excerpt instead of post->post_excerpt --- includes/client/posts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/client/posts.php b/includes/client/posts.php index b0af23f..bc48910 100644 --- a/includes/client/posts.php +++ b/includes/client/posts.php @@ -39,6 +39,7 @@ function handle_post_status_change( $new_status, $old_status, $post ) { Return an object of type Article */ function post_to_object( $post ) { + setup_postdata( $post ); $permalink = get_permalink( $post ); $matches = array(); if ( preg_match( '/(.+)__trashed\/$/', $permalink, $matches ) ) { @@ -53,7 +54,7 @@ function post_to_object( $post ) { null, sprintf( '/pterotype/v1/actor/%s', PTEROTYPE_BLOG_ACTOR_SLUG ) ), 'url' => $permalink, - 'summary' => $post->post_excerpt, + 'summary' => get_the_excerpt( $post ), ); $existing = get_existing_object( $permalink ); if ( $existing ) {