Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added conditional to verify the $user object is set in prepare_author method. #54

Merged
merged 1 commit into from

3 participants

@rachelbaker
Owner

Intended to resolve issue #51.

@rmccue rmccue added this to the 0.9 milestone
@rmccue rmccue merged commit c9eabc5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2013
  1. @rachelbaker
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/class-wp-json-posts.php
View
4 lib/class-wp-json-posts.php
@@ -632,8 +632,10 @@ protected function prepare_meta( $post_id ) {
protected function prepare_author( $author ) {
$user = get_user_by( 'id', $author );
- if (!$author)
+ if (! $author || ! is_object( $user ) ) {
return null;
+ }
+
$author = array(
'ID' => $user->ID,
Something went wrong with that request. Please try again.