| @@ -52,9 +52,11 @@ | ||
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | 54 | if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { |
| 55 | 55 | foreach ( $terms as $term ) { |
| 56 | - $options[ $term->{$key} ] = $term->name; | |
| 56 | + // Decode HTML entities (e.g. "&" → "&") so the select2 control | |
| 57 | + // shows the real term name instead of the escaped entity. | |
| 58 | + $options[ $term->{$key} ] = wp_specialchars_decode( $term->name, ENT_QUOTES ); | |
| 57 | 59 | } |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | return $options; |