WPCF7_ConstantContact_ContactPostRequest::add_street_address()publicCF7 1.0

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

Хуков нет.

Возвращает

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

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

$WPCF7_ConstantContact_ContactPostRequest = new WPCF7_ConstantContact_ContactPostRequest();
$WPCF7_ConstantContact_ContactPostRequest->add_street_address( $street, $city, $state, $postal_code, $country, $kind );
$street (обязательный)
-
$city (обязательный)
-
$state (обязательный)
-
$postal_code (обязательный)
-
$country (обязательный)
-
$kind **
-
По умолчанию: 'home'

Код WPCF7_ConstantContact_ContactPostRequest::add_street_address() CF7 5.9.3

public function add_street_address( $street, $city, $state, $postal_code, $country, $kind = 'home' ) {
	$street = trim( $street );
	$city = trim( $city );
	$state = trim( $state );
	$postal_code = trim( $postal_code );
	$country = trim( $country );

	if ( ! ( $street || $city || $state || $postal_code || $country )
	or 1 <= count( $this->street_addresses )
	or ! in_array( $kind, array( 'home', 'work', 'other' ) )
	or 255 < $this->strlen( $street )
	or 50 < $this->strlen( $city )
	or 50 < $this->strlen( $state )
	or 50 < $this->strlen( $postal_code )
	or 50 < $this->strlen( $country ) ) {
		return false;
	}

	return $this->street_addresses[] = array(
		'kind' => $kind,
		'street' => $street,
		'city' => $city,
		'state' => $state,
		'postal_code' => $postal_code,
		'country' => $country,
	);
}