diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 799ef1e..f93199c 100644
|
|
function wp_ajax_ajax_tag_search() { |
146 | 146 | |
147 | 147 | $results = get_terms( $taxonomy, array( 'name__like' => $s, 'fields' => 'names', 'hide_empty' => false ) ); |
148 | 148 | |
| 149 | /** |
| 150 | * Filter the already added tags to a post/page. |
| 151 | * @since 4.0.0 |
| 152 | */ |
| 153 | if ( isset( $_GET['addedTags'] ) ) { |
| 154 | |
| 155 | foreach ( $results as $key => $value ) { |
| 156 | if ( in_array( $value, $_GET['addedTags'] ) ) { |
| 157 | unset( $results[$key] ); |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
149 | 162 | echo join( $results, "\n" ); |
150 | 163 | wp_die(); |
151 | 164 | } |
diff --git src/wp-includes/js/jquery/suggest.js src/wp-includes/js/jquery/suggest.js
index 87f3012..51a7e87 100644
|
|
|
118 | 118 | |
119 | 119 | } else { |
120 | 120 | |
121 | | $.get(options.source, {q: q}, function(txt) { |
| 121 | if ( $('.tagchecklist span').length !== 0 ) { |
| 122 | |
| 123 | var addedTags = []; |
| 124 | |
| 125 | $('.tagchecklist span').each( function(span){ |
| 126 | var spanContent = $(this).html(); |
| 127 | |
| 128 | spanContent = spanContent.split( ' ' ).pop(); |
| 129 | |
| 130 | addedTags.push( spanContent ); |
| 131 | |
| 132 | }); |
| 133 | } |
| 134 | |
| 135 | $.get(options.source, {q: q, addedTags: addedTags}, function(txt) { |
122 | 136 | |
123 | 137 | $results.hide(); |
124 | 138 | |