I tried to use the filter wp_get_object_terms
like this:
function add_object_terms($terms, $object_ids, $taxonomies, $args){
if (isset( $_GET[ 'tags' ]) && str_replace("'","",$taxonomies) == "post_tag") {
$newterms = explode(",",$_GET['tags']);
return array_merge($terms, $newterms);
} else {
return $terms;
}
}
add_filter('wp_get_object_terms', 'add_object_terms',1,4);
That doesn’t work though, maybe the return value has the wrong format, I didn’t look it up, instead I tried another filter like this:
function add_tags($tags_to_edit, $taxonomy){
if (isset( $_GET[ 'tags' ]) && $taxonomy == 'post_tag') {
return $_GET['tags'];
} else {
return $tags_to_edit;
}
}
add_filter('terms_to_edit', 'add_tags',1,2);
That works but only if you also use the first filter as well, that’s because the second filter won’t run if there are no terms to deal with.