Skip to content

Commit

Permalink
Merge pull request #86 from contactashish13/development
Browse files Browse the repository at this point in the history
use slug not label name #85
  • Loading branch information
selul authored Sep 28, 2016
2 parents c0e008b + 95205f3 commit cd2a9b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions inc/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2548,11 +2548,11 @@ public static function generateFieldType($field)
) );
if(!empty($terms)){
// Added by Ash/Upwork
$options = array();
$options = array();
foreach ($terms as $t) {
$options[$t->name] = $t->term_id;
$options[] = array("label" => $t->name, "id" => $t->term_id);
}
$taxonomies[$tx->labels->name] = $options;
$taxonomies[] = array("label" => $tx->labels->name, "values" => $options);
// Added by Ash/Upwork
}
}
Expand Down
8 changes: 6 additions & 2 deletions inc/view-categories-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
<select name="<?php echo $field['option'];?>[]" data-placeholder="<?php _e("Categories", "tweet-old-post");?>" class="top-chosen-select" multiple>
<option value=""></option>
<?php
foreach ($taxonomies as $type=>$options) {
foreach ($taxonomies as $taxonomy) {
$type = $taxonomy["label"];
$options = $taxonomy["values"];
?>
<optgroup label="<?php echo $type?>">
<?php
foreach ($options as $label=>$id) {
foreach ($options as $option) {
$label = $option["label"];
$id = $option["id"];
$extra = in_array($id, $top_opt_omit_specific_cats) ? "selected" : "";
?>
<option value="<?php echo $id;?>" <?php echo $extra;?>><?php echo $label;?></option>
Expand Down

0 comments on commit cd2a9b4

Please sign in to comment.