@@ 1472-1485 (lines=14) @@ | ||
1469 | /** |
|
1470 | * Get the wpcom user data of the current|specified connected user. |
|
1471 | */ |
|
1472 | public static function get_connected_user_data( $user_id = null ) { |
|
1473 | if ( ! $user_id ) { |
|
1474 | $user_id = get_current_user_id(); |
|
1475 | } |
|
1476 | Jetpack::load_xml_rpc_client(); |
|
1477 | $xml = new Jetpack_IXR_Client( array( |
|
1478 | 'user_id' => $user_id, |
|
1479 | ) ); |
|
1480 | $xml->query( 'wpcom.getUser' ); |
|
1481 | if ( ! $xml->isError() ) { |
|
1482 | return $xml->getResponse(); |
|
1483 | } |
|
1484 | return false; |
|
1485 | } |
|
1486 | ||
1487 | /** |
|
1488 | * Get the wpcom email of the current|specified connected user. |
|
@@ 1490-1503 (lines=14) @@ | ||
1487 | /** |
|
1488 | * Get the wpcom email of the current|specified connected user. |
|
1489 | */ |
|
1490 | public static function get_connected_user_email( $user_id = null ) { |
|
1491 | if ( ! $user_id ) { |
|
1492 | $user_id = get_current_user_id(); |
|
1493 | } |
|
1494 | Jetpack::load_xml_rpc_client(); |
|
1495 | $xml = new Jetpack_IXR_Client( array( |
|
1496 | 'user_id' => $user_id, |
|
1497 | ) ); |
|
1498 | $xml->query( 'wpcom.getUserEmail' ); |
|
1499 | if ( ! $xml->isError() ) { |
|
1500 | return $xml->getResponse(); |
|
1501 | } |
|
1502 | return false; |
|
1503 | } |
|
1504 | ||
1505 | /** |
|
1506 | * Get the wpcom email of the master user. |
@@ 144-159 (lines=16) @@ | ||
141 | <?php |
|
142 | } |
|
143 | ||
144 | function get_post_by_email_address() { |
|
145 | Jetpack::load_xml_rpc_client(); |
|
146 | $xml = new Jetpack_IXR_Client( array( |
|
147 | 'user_id' => get_current_user_id(), |
|
148 | ) ); |
|
149 | $xml->query( 'jetpack.getPostByEmailAddress' ); |
|
150 | ||
151 | if ( $xml->isError() ) |
|
152 | return NULL; |
|
153 | ||
154 | $response = $xml->getResponse(); |
|
155 | if ( empty( $response ) ) |
|
156 | return NULL; |
|
157 | ||
158 | return $response; |
|
159 | } |
|
160 | ||
161 | function create_post_by_email_address() { |
|
162 | self::__process_ajax_proxy_request( |