A Tiny Improvement for Tag Plugin
  • I’m assigning tags in these days (with no mass technique yet), I have created 582 tags so far, but most of them are issued only once yet. I was thinking about how tiring and disillusioning it may be if a visitor clicks on a tag at the bottom of an entry, and will be presented with a listing of only that very article.
    So I made a small modification in Piero’s Tag plugin. Entry.php, in the function smarty_modifier, I modified the main loop as follows:
    foreach($array as $v) {

    /// by LAttilaD
    $realfile=PLUGIN_TAG_DIR.substr($v, 0, 1).'.txt';
    if(file_exists($realfile)) {
    include $realfile;
    $cnt=count($tag[$v]);
    }
    /// end

    # To be compatible with Flatpress System, we use the filter
    $link=apply_filters('tag_link', $v);
    $v=wp_specialchars($v, true); // LAttilaD  v-----here-----v
    $links[]="\n".'<a href="'.$link.'" title="'.$cnt.' articles">'.$v.'</a>';
    }
    Everything above and below this are the same. I know „articles” should be moved into the language file, but this is just a sketch.
    Now if you mouse over a tag listed at the bottom of an entry, „1 articles” appear in the tooltip. (In fact, I wrote it in Hungarian, where there’s no need to handle plurals. A professional solution should do that, too.)

    What do you think?