@@ 137-152 (lines=16) @@ | ||
134 | <?php |
|
135 | } |
|
136 | ||
137 | function get_post_by_email_address() { |
|
138 | Jetpack::load_xml_rpc_client(); |
|
139 | $xml = new Jetpack_IXR_Client( array( |
|
140 | 'user_id' => get_current_user_id(), |
|
141 | ) ); |
|
142 | $xml->query( 'jetpack.getPostByEmailAddress' ); |
|
143 | ||
144 | if ( $xml->isError() ) |
|
145 | return NULL; |
|
146 | ||
147 | $response = $xml->getResponse(); |
|
148 | if ( empty( $response ) ) |
|
149 | return NULL; |
|
150 | ||
151 | return $response; |
|
152 | } |
|
153 | ||
154 | function create_post_by_email_address() { |
|
155 | self::__process_ajax_proxy_request( |
@@ 1182-1195 (lines=14) @@ | ||
1179 | /** |
|
1180 | * Get the wpcom user data of the current|specified connected user. |
|
1181 | */ |
|
1182 | public static function get_connected_user_data( $user_id = null ) { |
|
1183 | if ( ! $user_id ) { |
|
1184 | $user_id = get_current_user_id(); |
|
1185 | } |
|
1186 | Jetpack::load_xml_rpc_client(); |
|
1187 | $xml = new Jetpack_IXR_Client( array( |
|
1188 | 'user_id' => $user_id, |
|
1189 | ) ); |
|
1190 | $xml->query( 'wpcom.getUser' ); |
|
1191 | if ( ! $xml->isError() ) { |
|
1192 | return $xml->getResponse(); |
|
1193 | } |
|
1194 | return false; |
|
1195 | } |
|
1196 | ||
1197 | /** |
|
1198 | * Get the wpcom email of the current|specified connected user. |
|
@@ 1200-1213 (lines=14) @@ | ||
1197 | /** |
|
1198 | * Get the wpcom email of the current|specified connected user. |
|
1199 | */ |
|
1200 | public static function get_connected_user_email( $user_id = null ) { |
|
1201 | if ( ! $user_id ) { |
|
1202 | $user_id = get_current_user_id(); |
|
1203 | } |
|
1204 | Jetpack::load_xml_rpc_client(); |
|
1205 | $xml = new Jetpack_IXR_Client( array( |
|
1206 | 'user_id' => $user_id, |
|
1207 | ) ); |
|
1208 | $xml->query( 'wpcom.getUserEmail' ); |
|
1209 | if ( ! $xml->isError() ) { |
|
1210 | return $xml->getResponse(); |
|
1211 | } |
|
1212 | return false; |
|
1213 | } |
|
1214 | ||
1215 | /** |
|
1216 | * Get the wpcom email of the master user. |