WC_Admin_List_Table_Coupons::render_filters()protectedWC 1.0

Render any custom filters and search inputs for the list table.

{} It's a method of the class: WC_Admin_List_Table_Coupons{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->render_filters();

Code of WC_Admin_List_Table_Coupons::render_filters() WC 6.7.0

<?php
protected function render_filters() {
	?>
	<select name="coupon_type" id="dropdown_shop_coupon_type">
		<option value=""><?php esc_html_e( 'Show all types', 'woocommerce' ); ?></option>
		<?php
		$types = wc_get_coupon_types();

		foreach ( $types as $name => $type ) {
			echo '<option value="' . esc_attr( $name ) . '"';

			if ( isset( $_GET['coupon_type'] ) ) { // WPCS: input var ok.
				selected( $name, wc_clean( wp_unslash( $_GET['coupon_type'] ) ) ); // WPCS: input var ok, sanitization ok.
			}

			echo '>' . esc_html( $type ) . '</option>';
		}
		?>
	</select>
	<?php
}