| @@ 143-158 (lines=16) @@ | ||
| 140 | <?php |
|
| 141 | } |
|
| 142 | ||
| 143 | function get_post_by_email_address() { |
|
| 144 | Jetpack::load_xml_rpc_client(); |
|
| 145 | $xml = new Jetpack_IXR_Client( array( |
|
| 146 | 'user_id' => get_current_user_id(), |
|
| 147 | ) ); |
|
| 148 | $xml->query( 'jetpack.getPostByEmailAddress' ); |
|
| 149 | ||
| 150 | if ( $xml->isError() ) |
|
| 151 | return NULL; |
|
| 152 | ||
| 153 | $response = $xml->getResponse(); |
|
| 154 | if ( empty( $response ) ) |
|
| 155 | return NULL; |
|
| 156 | ||
| 157 | return $response; |
|
| 158 | } |
|
| 159 | ||
| 160 | function create_post_by_email_address() { |
|
| 161 | self::__process_ajax_proxy_request( |
|
| @@ 1563-1576 (lines=14) @@ | ||
| 1560 | /** |
|
| 1561 | * Get the wpcom user data of the current|specified connected user. |
|
| 1562 | */ |
|
| 1563 | public static function get_connected_user_data( $user_id = null ) { |
|
| 1564 | if ( ! $user_id ) { |
|
| 1565 | $user_id = get_current_user_id(); |
|
| 1566 | } |
|
| 1567 | Jetpack::load_xml_rpc_client(); |
|
| 1568 | $xml = new Jetpack_IXR_Client( array( |
|
| 1569 | 'user_id' => $user_id, |
|
| 1570 | ) ); |
|
| 1571 | $xml->query( 'wpcom.getUser' ); |
|
| 1572 | if ( ! $xml->isError() ) { |
|
| 1573 | return $xml->getResponse(); |
|
| 1574 | } |
|
| 1575 | return false; |
|
| 1576 | } |
|
| 1577 | ||
| 1578 | /** |
|
| 1579 | * Get the wpcom email of the current|specified connected user. |
|
| @@ 1581-1594 (lines=14) @@ | ||
| 1578 | /** |
|
| 1579 | * Get the wpcom email of the current|specified connected user. |
|
| 1580 | */ |
|
| 1581 | public static function get_connected_user_email( $user_id = null ) { |
|
| 1582 | if ( ! $user_id ) { |
|
| 1583 | $user_id = get_current_user_id(); |
|
| 1584 | } |
|
| 1585 | Jetpack::load_xml_rpc_client(); |
|
| 1586 | $xml = new Jetpack_IXR_Client( array( |
|
| 1587 | 'user_id' => $user_id, |
|
| 1588 | ) ); |
|
| 1589 | $xml->query( 'wpcom.getUserEmail' ); |
|
| 1590 | if ( ! $xml->isError() ) { |
|
| 1591 | return $xml->getResponse(); |
|
| 1592 | } |
|
| 1593 | return false; |
|
| 1594 | } |
|
| 1595 | ||
| 1596 | /** |
|
| 1597 | * Get the wpcom email of the master user. |
|