| @@ 822-832 (lines=11) @@ | ||
| 819 | * |
|
| 820 | * @return Boolean Whether the disconnection of the user was successful. |
|
| 821 | */ |
|
| 822 | public function unlink_user_from_wpcom( $user_id ) { |
|
| 823 | // Attempt to disconnect the user from WordPress.com. |
|
| 824 | $xml = new Jetpack_IXR_Client( compact( 'user_id' ) ); |
|
| 825 | ||
| 826 | $xml->query( 'jetpack.unlink_user', $user_id ); |
|
| 827 | if ( $xml->isError() ) { |
|
| 828 | return false; |
|
| 829 | } |
|
| 830 | ||
| 831 | return (bool) $xml->getResponse(); |
|
| 832 | } |
|
| 833 | ||
| 834 | /** |
|
| 835 | * Update the connection owner. |
|
| @@ 899-917 (lines=19) @@ | ||
| 896 | * |
|
| 897 | * @return Boolean Whether the ownership transfer was successful. |
|
| 898 | */ |
|
| 899 | public function update_connection_owner_wpcom( $new_owner_id ) { |
|
| 900 | // Notify WPCOM about the connection owner change. |
|
| 901 | $xml = new Jetpack_IXR_Client( |
|
| 902 | array( |
|
| 903 | 'user_id' => get_current_user_id(), |
|
| 904 | ) |
|
| 905 | ); |
|
| 906 | $xml->query( |
|
| 907 | 'jetpack.switchBlogOwner', |
|
| 908 | array( |
|
| 909 | 'new_blog_owner' => $new_owner_id, |
|
| 910 | ) |
|
| 911 | ); |
|
| 912 | if ( $xml->isError() ) { |
|
| 913 | return false; |
|
| 914 | } |
|
| 915 | ||
| 916 | return (bool) $xml->getResponse(); |
|
| 917 | } |
|
| 918 | ||
| 919 | /** |
|
| 920 | * Returns the requested Jetpack API URL. |
|