WPCF7_ConstantContact::email_exists()
Метод класса: WPCF7_ConstantContact{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WPCF7_ConstantContact = new WPCF7_ConstantContact(); $WPCF7_ConstantContact->email_exists( $email );
- $email (обязательный)
- -
Код WPCF7_ConstantContact::email_exists() WPCF7 ConstantContact::email exists CF7 5.9.3
public function email_exists( $email ) { $endpoint = add_query_arg( array( 'email' => $email, 'status' => 'all', ), 'https://api.cc.email/v3/contacts' ); $request = array( 'method' => 'GET', 'headers' => array( 'Accept' => 'application/json', 'Content-Type' => 'application/json; charset=utf-8', ), ); $response = $this->remote_request( $endpoint, $request ); if ( 400 <= (int) wp_remote_retrieve_response_code( $response ) ) { if ( WP_DEBUG ) { $this->log( $endpoint, $request, $response ); } return false; } $response_body = wp_remote_retrieve_body( $response ); if ( empty( $response_body ) ) { return false; } $response_body = json_decode( $response_body, true ); return ! empty( $response_body['contacts'] ); }