Skip to content

Instantly share code, notes, and snippets.

@bhwebworks
Created January 29, 2012 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhwebworks/1696474 to your computer and use it in GitHub Desktop.
Save bhwebworks/1696474 to your computer and use it in GitHub Desktop.
Add the category option to the widget's form
<p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" />
</p>
<p><!-- this adds the category option to the widget's form -->
<label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Category ID','dbem'); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>" size="3" value="<?php echo $instance['category']; ?>" /><br />
<label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('(separate multiple IDs by commas, or use "0" for all categories)','dbem'); ?> </label>
</p>
<p>
<label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e('Number of events','dbem'); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" size="3" value="<?php echo $instance['limit']; ?>" />
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment