title: wordpress wp_get_current_user data not displaying in jason-api
body: <p>I want to display a WordPress logged in user ID and email in another website so, I'm using the wordpress<code>json-api</code> plugin to create an api but it's not working.<br>
  When I hit a direct link, it displays data as: </p>
  
  <pre><code>"{\"id\":1,\"email\":\"admin@admin.com\"}" 
  </code></pre>
  
  <p>But when I use <code>json_decode</code> and print data, it displays:   </p>
  
  <pre><code>string(22) "{"id":0,"email":false}"
  </code></pre>
  
  <p>api code</p>
  
  <pre><code>public function get_loggedin_user_details() {
      global $user;
      global $wpdb, $json_api;
      $current_user = wp_get_current_user();
      $myObj-&gt;id = $current_user-&gt;ID;
      $myObj-&gt;email = $current_user-&gt;user_email;
      $logedin_userid = json_encode($myObj);
      return $logedin_userid;
    }
  </code></pre>