Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#5156 closed enhancement (wontfix)

Ability to easily add tags to posts using a list of existing tags...

Reported by: andrewflanagan's profile andrewflanagan Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: Optimization Keywords: tags, javascript, add, ease of use
Focuses: Cc:


I love the new built-in tagging in 2.3. One of the things that I thought would be helpful is to have a list of tags displayed for you so that you can just click on them and add them to the list rather than always having to type them. I make typos and I'm sure others do. At the same time, I have at least a SOMEWHAT limited number of tags (under 100) so this functionality seems useful.

Here's what I did to make this work on my site with Wordpress 2.3.

In the file wp-admin/edit-form-advanced.php, insert the following: (between line 161 and 162)

begin code

<script type="text/javascript">
function setTag(text)

var curvalue = document.getElementById('tags-input').value;

if (curvalue == "")

document.getElementById('tags-input').value = text;


document.getElementById('tags-input').value = curvalue + ", " + text;


$output = "<legend>";
$tags = (array) get_terms('post_tag', $args);
foreach ($tags as $tag)

$output .= "<a href=\"#\" onClick=\"setTag('".$tag->name."')\">".$tag->name."</a>,";

$output = substr($output, 0, strlen($output) - 1);
$output .= "</legend>";
echo $output;

end code

I'm sure that this is sloppy but it works... I now get a list of tags that I can click and automatically add to the tag list (and it inserts commas as you'd expect). Anyway -- maybe this can be an option somewhere since obviously it might be a bit much if you had a huge amount of tags.

Change History (3)

#1 @foolswisdom
17 years ago

  • Milestone changed from 2.3.1 to 2.4

#2 @ffemtcj
16 years ago

  • Milestone changed from 2.5 to 2.7

No Patch. Moved to 2.7

#3 @ryan
16 years ago

  • Milestone 2.7 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

We have tag suggestions now, which is good enough.

Note: See TracTickets for help on using tickets.