Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::get_posted_textarea_value │ private │ WC 1.0

Get a sanitized textarea value from the current POST request.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->get_posted_textarea_value( $field_name ): string;
$field_name(string) (required)
Field name.

OrderWithdrawalFormProcessor::get_posted_textarea_value() code WC 11.1.2

private function get_posted_textarea_value( string $field_name ): string {
	// phpcs:disable WordPress.Security.NonceVerification.Missing -- Nonce verification happens before submitted data is used.
	if ( ! isset( $_POST[ $field_name ] ) || ! is_scalar( $_POST[ $field_name ] ) ) {
		return '';
	}

	return sanitize_textarea_field( wp_unslash( (string) $_POST[ $field_name ] ) );
	// phpcs:enable WordPress.Security.NonceVerification.Missing
}