Inventory_Presser_Grid::widget( array $args, array $instance )

widget


Description Description

Outputs the widget front-end HTML


Top ↑

Parameters Parameters

$args

(array) (Required)

$instance

(array) (Required)


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-widget-inventory-grid.php

	public function widget( $args, $instance ) {

		//build $args array
		$content_args = array();
		if( isset( $instance['columns'] ) ) {
			$content_args['columns'] = $instance['columns'];
		}
		if( isset( $instance['limit'] ) ) {
			$content_args['limit'] = $instance['limit'];
		}
		if( isset( $instance['cb_showcaptions'] ) ) {
			$content_args['show_captions'] = ( $instance['cb_showcaptions'] == 'true' );
		}
		if( isset( $instance['cb_showbutton'] ) ) {
			$content_args['show_button'] = ( $instance['cb_showbutton'] == 'true' );
		}
		if( isset( $instance['cb_showprices'] ) ) {
			$content_args['show_prices'] = ( $instance['cb_showprices'] == 'true' );
		}

		// before and after widget arguments are defined by themes
		echo $args['before_widget'];
		$title = apply_filters( 'widget_title', $instance['title'] );
		if ( ! empty( $title ) ) {
			echo $args['before_title'] . $title . $args['after_title'];
		}

		echo $this->content( $content_args ) . $args['after_widget'];
	}