﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
10544	Specify tags on new posts through the URL	rvenable		"I want to create links like such: ""Add a new post with tag X"" with a URL like this: wp-admin/post-new.php?new_tag=X

Clicking on the link would take you to the Add New Post admin panel with tag X already added. 

Unfortunately, there is no clean way for a plugin to make this work. The only clean way would be to add a filter on 'terms_to_edit' which adds the new_tag var to the end of the terms. 

Unfortunately, get_terms_to_edit() returns early if there is no post ID and never reaches the necessary filter:


{{{
function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
	$post_id = (int) $post_id;
	if ( !$post_id )
		return false; // <------ BAILS OUT EARLY HERE

	$tags = wp_get_post_terms($post_id, $taxonomy, array());

	if ( !$tags )
		return false;

	if ( is_wp_error($tags) )
		return $tags;

	foreach ( $tags as $tag )
		$tag_names[] = $tag->name;
	$tags_to_edit = join( ',', $tag_names );
	$tags_to_edit = esc_attr( $tags_to_edit );
	$tags_to_edit = apply_filters( 'terms_to_edit', $tags_to_edit, $taxonomy );   // <-------- THE FILTER I NEED TO HOOK ONTO TO ADD MY NEW TAG

	return $tags_to_edit;
}
}}}

So, a possible solution would be to still apply the filter when bailing out on an empty post_id.
"	enhancement	closed	low		Plugins	2.8.1	minor	duplicate		
