'adplugg', 'description' => 'A widget for displaying ads.' ); parent::__construct( 'adplugg', $name = 'AdPlugg', $widget_options ); } /** * Widget form creation. Displays the form in the widget admin. * @param array $instance Current settings */ public function form( $instance ) { // Check values $title = ( ( $instance ) && ( isset( $instance['title'] ) ) ) ? $instance['title'] : ''; $zone = ( ( $instance ) && ( isset( $instance['zone'] ) ) ) ? $instance['zone'] : ''; $width = ( ( $instance ) && ( isset( $instance['width'] ) ) ) ? $instance['width'] : ''; $height = ( ( $instance ) && ( isset( $instance['height'] ) ) ) ? $instance['height'] : ''; $default = ( ( $instance ) && ( isset( $instance['default'] ) ) ) ? $instance['default'] : 0; //This is used below to set the title of the widget that is displayed within the admin. //It is passed to widgets.js based on the '-title' id suffix $widget_title = ( $zone != '' ) ? $zone : ''; //Render the form //Note: we always render all fields but sometimes hide certain fields //via css (admin.css) if they aren't relevant to the widget area. ?>

Configure at adplugg.com | Help

Optional Settings Settings
get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" type="text" value="' . $title . '" />'; ?> Enter a title for the widget.
get_field_id( 'zone' ) . '" name="' . $this->get_field_name( 'zone' ) . '" type="text" value="' . $zone . '" />'; ?> Enter the zone machine name.
get_field_id( 'width' ) . '" name="' . $this->get_field_name( 'width' ) . '" type="text" value="' . $width . '" />'; ?> Enter the width.
get_field_id( 'height' ) . '" name="' . $this->get_field_name( 'height' ) . '" type="text" value="' . $height . '" />'; ?> Enter the height.

Check to make this zone the default.
\n"; echo '' . "\n"; echo "\n"; } } else { // --------------------- NORMAL OUTPUT -------------------// echo $before_widget; // Render the title (if there is one). if ( $title ) { echo $before_title . $title . $after_title; } // Add the AdPlugg tag echo '
'; echo $after_widget; } } }