MortgageRates_Widget::form( array $instance )

Widget Backend.


Parameters Parameters

$instance

(array) (Required) instance


Top ↑

Source Source

File: mortgage-rates-widget/inc/MortgageRates_Widget.php

	public function form( $instance ) {

		$defaults = array(
			'title'         => ' ',
			'type' => 'table'
		);
		$instance = wp_parse_args( (array) $instance, $defaults );
		?>

		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo esc_html__( 'Title', 'MortgageNewsWidget' ); ?></label>
			<input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
			       name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
			       value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" type="text"/>
		</p>

		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>"><?php echo esc_html__( 'Mortgage rates type', 'MortgageNewsWidget' ); ?></label>
			<select id="<?php echo $this->get_field_id('type'); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'type' ) ); ?>">
				<option <?php selected( $instance['type'], 'table' ); ?> value="table">Table</option>
				<option <?php selected( $instance['type'], 'fusion' ); ?> value="fusion">Fusion chart</option>
				<option <?php selected( $instance['type'], 'amchart' ); ?> value="amchart">Amchart</option>
				<option <?php selected( $instance['type'], 'scroller-1' ); ?> value="scroller-1">Scroller-1</option>
				<option <?php selected( $instance['type'], 'scroller-2' ); ?> value="scroller-2">Scroller-2</option>
				<option <?php selected( $instance['type'], 'scroller-3' ); ?> value="scroller-3">Scroller-3</option>
				<option <?php selected( $instance['type'], 'scroller-4' ); ?> value="scroller-4">Scroller-4</option>
				<option <?php selected( $instance['type'], 'list' ); ?> value="list">Text</option>
				<option <?php selected( $instance['type'], 'plaintext' ); ?> value="plaintext">Plaintext</option>
			</select>
		</p>
		<?php
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.