function arras_get_terms_list($taxonomy) { $terms = get_terms($taxonomy, 'hide_empty=0'); $opt = array(); if (!is_wp_error($terms)) { foreach ($terms as $term) { if ($taxonomy == 'category' || ($taxonomy = 'post_tag')) { $opt[$term->term_id] = $term->name; } else { $opt[$term->slug] = $term->name; } } } return array('-5' => __('Stickied Posts', 'arras'), arras_get_taxonomy_name($taxonomy) => $opt); }
<tr valign="top"> <th scope="row"><label for="arras-layout-news-title"><?php _e('Title', 'arras'); ?> </label></th> <td> <?php echo arras_form_input(array('name' => 'arras-layout-news-title', 'id' => 'arras-layout-news-title', 'style' => 'width:60%', 'value' => arras_get_option('news_title'))); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-cat-news"><?php printf(__('Stickied Posts / %s', 'arras'), arras_get_taxonomy_name(arras_get_option('news_tax'))); ?> </label></th> <td> <?php echo arras_form_dropdown('arras-cat-news[]', arras_get_terms_list(arras_get_option('news_tax')), arras_get_option('news_cat'), 'class="multiple" multiple="multiple"'); ?> <br /><?php _e('Selected categories will be shown below the featured section in the index page.', 'arras'); ?> </td> </tr> <tr valign="top"> <th scope="row"><label for="arras-layout-index-newsdisplay"><?php _e('Tapestry (Display Type)', 'arras');