Created
February 4, 2012 17:33
-
-
Save jchristopher/1739100 to your computer and use it in GitHub Desktop.
The form() for our Image of the Month Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function form( $instance ) | |
{ | |
$headline = esc_attr( isset( $instance['headline'] ) ? $instance['headline'] : '' ); | |
$image_id = esc_attr( isset( $instance[$this->image_field] ) ? $instance[$this->image_field] : 0 ); | |
$blurb = esc_attr( isset( $instance['blurb'] ) ? $instance['blurb'] : '' ); | |
$image = new WidgetImageField( $this, $image_id ); | |
?> | |
<p> | |
<label for="<?php echo $this->get_field_id( 'headline' ); ?>"><?php _e( 'Headline:' ); ?> | |
<input class="widefat" id="<?php echo $this->get_field_id( 'headline' ); ?>" name="<?php echo $this->get_field_name( 'headline' ); ?>" type="text" value="<?php echo $headline; ?>" /> | |
</label> | |
</p> | |
<div> | |
<label><?php _e( 'Image:' ); ?></label> | |
<?php echo $image->get_widget_field(); ?> | |
</div> | |
<p> | |
<label for="<?php echo $this->get_field_id( 'blurb' ); ?>"><?php _e( 'Blurb:' ); ?> | |
<input class="widefat" id="<?php echo $this->get_field_id( 'blurb' ); ?>" name="<?php echo $this->get_field_name( 'blurb' ); ?>" type="text" value="<?php echo $blurb; ?>" /> | |
</label> | |
</p> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment