Advertisement
gregrickaby

Featured Category Select

Jan 11th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. $current = $this->get_field_value( 'jflow_category' );
  2. echo '<label>Featured Category: </label>';
  3.     echo '<select name="' . $this->get_field_name( 'jflow_category' ) . '" id="' . $this->get_field_id( 'jflow_category' ) . '">';
  4.     $cats = get_categories( 'type=post&orderby=name&hide_empty=0' );
  5.     foreach( $cats as $cat ) {
  6.     echo '<option value="' . $cat->cat_ID . '"' . selected( $current, $cat->cat_ID )  . '>' . $cat->cat_name. '</option>';
  7.     }
  8. echo '</select></p>';
  9. echo '<p><span class="description">Selected the featured category</span></p>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement