Automattic\WooCommerce\Internal\Admin\Orders

ListTable::print_hidden_form_fields()privateWC 1.0

Outputs hidden fields used to retain state when filtering.

Method of the class: ListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->print_hidden_form_fields(): void;

ListTable::print_hidden_form_fields() code WC 8.7.0

private function print_hidden_form_fields(): void {
	echo '<input type="hidden" name="page" value="wc-orders' . ( 'shop_order' === $this->order_type ? '' : '--' . $this->order_type ) . '" >'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

	$state_params = array(
		'paged',
		'status',
	);

	foreach ( $state_params as $param ) {
		if ( ! isset( $_GET[ $param ] ) ) {
			continue;
		}

		echo '<input type="hidden" name="' . esc_attr( $param ) . '" value="' . esc_attr( sanitize_text_field( wp_unslash( $_GET[ $param ] ) ) ) . '" >';
	}
}