WPCF7_ConstantContact_ContactPostRequest::add_custom_field()publicCF7 1.0

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

Хуков нет.

Возвращает

null. Ничего.

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

$WPCF7_ConstantContact_ContactPostRequest = new WPCF7_ConstantContact_ContactPostRequest();
$WPCF7_ConstantContact_ContactPostRequest->add_custom_field( $custom_field_id, $value );
$custom_field_id (обязательный)
-
$value (обязательный)
-

Код WPCF7_ConstantContact_ContactPostRequest::add_custom_field() CF7 5.6.4

public function add_custom_field( $custom_field_id, $value ) {
	$uuid_pattern = '/^[0-9a-f-]+$/i';

	$value = trim( $value );

	if ( 25 <= count( $this->custom_fields )
	or ! preg_match( $uuid_pattern, $custom_field_id )
	or 255 < $this->strlen( $value ) ) {
		return false;
	}

	return $this->custom_fields[] = array(
		'custom_field_id' => $custom_field_id,
		'value' => $value,
	);
}