Skip to content

Instantly share code, notes, and snippets.

@jpen365
Created November 16, 2016 03:37
Show Gist options
  • Save jpen365/d2528b9e5487bf871a6cf9311460c3d5 to your computer and use it in GitHub Desktop.
Save jpen365/d2528b9e5487bf871a6cf9311460c3d5 to your computer and use it in GitHub Desktop.
Display widget setting fields in the admin area.
<?php
public function form( $instance ) {
$title = ! empty( $instance['title'] ) ? $instance['title'] : ''; ?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label>
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>" />
</p><?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment