Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to pull up a custom page which lists all tags used in my blog that have a description, to build up a glossary.

It all works great but i would also like to display an "edit tag" link for each tag, only visible to admins. The built-in edit_tag_link() function is supposed to do just that, as far as i understand the codex, but the edit link does not show up. What is wrong with my code?

$tags = get_tags();
foreach ($tags as $tag){
    if(strlen($tag->description)>0){
            $tag_link = get_tag_link($tag->term_id);
            print_r($tag);
    echo "<li><a class='content-link' href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'><h3>{$tag->name}</h3>
    <pclass='abstract'>{$tag->description}</p></a> ".edit_tag_link('edit tag','<p>','</p>',$tag)."</li>";
    }

}
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Turns out the edit_term_link() function works fine for that.

        edit_term_link('edit tag','<p>','</p>',$tag);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.