WPCF7_ConstantContact::create_contact()publicCF7 1.0

Метод класса: WPCF7_ConstantContact{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WPCF7_ConstantContact = new WPCF7_ConstantContact();
$WPCF7_ConstantContact->create_contact( $properties );
$properties (обязательный)
-

Код WPCF7_ConstantContact::create_contact() CF7 5.9.8

public function create_contact( $properties ) {
	$endpoint = 'https://api.cc.email/v3/contacts';

	$request = array(
		'method' => 'POST',
		'headers' => array(
			'Accept' => 'application/json',
			'Content-Type' => 'application/json; charset=utf-8',
		),
		'body' => wp_json_encode( $properties ),
	);

	$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;
	}
}