• I got this error when trying to get an endpoint for a single menu:

    Trying to get property of non-object in /Users/photocurio/Sites/Whoopee/wp-content/plugins/wp-api-menus/includes/wp-api-menus-v2.php on line 386

    I managed to fix it by going into wp-api-menus-v2.php and replacing line 386:
    'object_slug' => get_post( $item['object_id'] )->post_name,
    with this:
    'object_slug' => basename($item['object_id']),

    I don’t know how to submit a pull request for a SVN repo, so I didn’t do that.

    • This topic was modified 7 years, 12 months ago by photocurio.
  • The topic ‘Cannot get property of non-object..’ is closed to new replies.