WC_Checkout::get_posted_address_data
Get a posted address field after sanitization and validation.
Метод класса: WC_Checkout{}
Хуков нет.
Возвращает
string.
Использование
$WC_Checkout = new WC_Checkout(); $WC_Checkout->get_posted_address_data( $key, $type );
- $key(строка) (обязательный)
- Field key.
- $type(строка)
- Type of address;
'billing'or'shipping'.
По умолчанию:'billing'
Код WC_Checkout::get_posted_address_data() WC Checkout::get posted address data WC 11.2.2
public function get_posted_address_data( $key, $type = 'billing' ) {
if ( 'billing' === $type || false === $this->legacy_posted_data['ship_to_different_address'] ) {
$return = isset( $this->legacy_posted_data[ 'billing_' . $key ] ) ? $this->legacy_posted_data[ 'billing_' . $key ] : '';
} else {
$return = isset( $this->legacy_posted_data[ 'shipping_' . $key ] ) ? $this->legacy_posted_data[ 'shipping_' . $key ] : '';
}
return $return;
}