| @@ 136-151 (lines=16) @@ | ||
| 133 | <?php |
|
| 134 | } |
|
| 135 | ||
| 136 | function get_post_by_email_address() { |
|
| 137 | Jetpack::load_xml_rpc_client(); |
|
| 138 | $xml = new Jetpack_IXR_Client( array( |
|
| 139 | 'user_id' => get_current_user_id(), |
|
| 140 | ) ); |
|
| 141 | $xml->query( 'jetpack.getPostByEmailAddress' ); |
|
| 142 | ||
| 143 | if ( $xml->isError() ) |
|
| 144 | return NULL; |
|
| 145 | ||
| 146 | $response = $xml->getResponse(); |
|
| 147 | if ( empty( $response ) ) |
|
| 148 | return NULL; |
|
| 149 | ||
| 150 | return $response; |
|
| 151 | } |
|
| 152 | ||
| 153 | function create_post_by_email_address() { |
|
| 154 | self::__process_ajax_proxy_request( |
|
| @@ 1344-1357 (lines=14) @@ | ||
| 1341 | /** |
|
| 1342 | * Get the wpcom user data of the current|specified connected user. |
|
| 1343 | */ |
|
| 1344 | public static function get_connected_user_data( $user_id = null ) { |
|
| 1345 | if ( ! $user_id ) { |
|
| 1346 | $user_id = get_current_user_id(); |
|
| 1347 | } |
|
| 1348 | Jetpack::load_xml_rpc_client(); |
|
| 1349 | $xml = new Jetpack_IXR_Client( array( |
|
| 1350 | 'user_id' => $user_id, |
|
| 1351 | ) ); |
|
| 1352 | $xml->query( 'wpcom.getUser' ); |
|
| 1353 | if ( ! $xml->isError() ) { |
|
| 1354 | return $xml->getResponse(); |
|
| 1355 | } |
|
| 1356 | return false; |
|
| 1357 | } |
|
| 1358 | ||
| 1359 | /** |
|
| 1360 | * Get the wpcom email of the current|specified connected user. |
|
| @@ 1362-1375 (lines=14) @@ | ||
| 1359 | /** |
|
| 1360 | * Get the wpcom email of the current|specified connected user. |
|
| 1361 | */ |
|
| 1362 | public static function get_connected_user_email( $user_id = null ) { |
|
| 1363 | if ( ! $user_id ) { |
|
| 1364 | $user_id = get_current_user_id(); |
|
| 1365 | } |
|
| 1366 | Jetpack::load_xml_rpc_client(); |
|
| 1367 | $xml = new Jetpack_IXR_Client( array( |
|
| 1368 | 'user_id' => $user_id, |
|
| 1369 | ) ); |
|
| 1370 | $xml->query( 'wpcom.getUserEmail' ); |
|
| 1371 | if ( ! $xml->isError() ) { |
|
| 1372 | return $xml->getResponse(); |
|
| 1373 | } |
|
| 1374 | return false; |
|
| 1375 | } |
|
| 1376 | ||
| 1377 | /** |
|
| 1378 | * Get the wpcom email of the master user. |
|