WPCF7_ConstantContact::email_exists() public CF7 1.0
{} Это метод класса: WPCF7_ConstantContact{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$WPCF7_ConstantContact = new WPCF7_ConstantContact(); $WPCF7_ConstantContact->email_exists( $email );
Код WPCF7_ConstantContact::email_exists() WPCF7 ConstantContact::email exists CF7 5.3.2
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'] );
}