From 08db923066fa9c509f9cb95b2b7ef280da0abf44 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 19 Oct 2018 06:18:31 -0400 Subject: [PATCH] Account for new post --- includes/client/posts.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/client/posts.php b/includes/client/posts.php index bc48910..f8edb70 100644 --- a/includes/client/posts.php +++ b/includes/client/posts.php @@ -41,6 +41,10 @@ Return an object of type Article function post_to_object( $post ) { setup_postdata( $post ); $permalink = get_permalink( $post ); + $summary = null; + if ( $post->post_content ) { + $summary = get_the_excerpt( $post ); + } $matches = array(); if ( preg_match( '/(.+)__trashed\/$/', $permalink, $matches ) ) { $permalink = $matches[1] . '/'; @@ -54,7 +58,7 @@ function post_to_object( $post ) { null, sprintf( '/pterotype/v1/actor/%s', PTEROTYPE_BLOG_ACTOR_SLUG ) ), 'url' => $permalink, - 'summary' => get_the_excerpt( $post ), + 'summary' => $summary, ); $existing = get_existing_object( $permalink ); if ( $existing ) {