json-endpoints/class.wpcom-json-api-site-user-endpoint.php 1 location
|
@@ 54-62 (lines=9) @@
|
| 51 |
|
} |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public function get_user( $user_id ) { |
| 55 |
|
$the_user = $this->get_author( $user_id, true ); |
| 56 |
|
if ( $the_user && ! is_wp_error( $the_user ) ) { |
| 57 |
|
$userdata = get_userdata( $user_id ); |
| 58 |
|
$the_user->roles = ! is_wp_error( $userdata ) ? $userdata->roles : array(); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
return $the_user; |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
/** |
| 65 |
|
* Updates user data |
json-endpoints/jetpack/class.jetpack-json-api-user-create-endpoint.php 1 location
|
@@ 51-59 (lines=9) @@
|
| 48 |
|
return $this->get_user( $user->ID ); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
public function get_user( $user_id ) { |
| 52 |
|
$the_user = $this->get_author( $user_id, true ); |
| 53 |
|
if ( $the_user && ! is_wp_error( $the_user ) ) { |
| 54 |
|
$userdata = get_userdata( $user_id ); |
| 55 |
|
$the_user->roles = ! is_wp_error( $userdata ) ? $userdata->roles : array(); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
return $the_user; |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
} |
| 62 |
|
|