WC_Widget_Brand_Nav::form()publicWC 1.0

Form function.

Method of the class: WC_Widget_Brand_Nav{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Widget_Brand_Nav = new WC_Widget_Brand_Nav();
$WC_Widget_Brand_Nav->form( $instance );
$instance(array) (required)
Widget instance.

Notes

  • See: WP_Widget->form

WC_Widget_Brand_Nav::form() code WC 9.5.1

<?php
public function form( $instance ) {
	global $woocommerce;

	if ( ! isset( $instance['display_type'] ) ) {
		$instance['display_type'] = 'list';
	}
	?>
	<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'woocommerce' ); ?></label>
	<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; ?>" />
	</p>

	<p><label for="<?php echo esc_attr( $this->get_field_id( 'display_type' ) ); ?>"><?php esc_html_e( 'Display Type:', 'woocommerce' ); ?></label>
	<select id="<?php echo esc_attr( $this->get_field_id( 'display_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'display_type' ) ); ?>">
		<option value="list" <?php selected( $instance['display_type'], 'list' ); ?>><?php esc_html_e( 'List', 'woocommerce' ); ?></option>
		<option value="dropdown" <?php selected( $instance['display_type'], 'dropdown' ); ?>><?php esc_html_e( 'Dropdown', 'woocommerce' ); ?></option>
	</select></p>
	<?php
}