WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/terms to edit

Description

This filter is used to modify the CSV of terms that is used to show active terms in the taxonomy sidebars on the edit post screen. The filter is located inside wp-admin/includes/taxonomy.php, within get_terms_to_edit()

Uses

This is primarily of use if you need to visually modify the appearance of an active term (such as prefixing an asterisk) without changing its behavior. Note that the returned CSV is filtered using JavaScript and is rendered in plain text, so wrapping terms in HTML will not work (any HTML will be rendered as text).

Example

add_filter('terms_to_edit','add_term_output');
function add_term_output($terms){
   global $taxonomy;
   if('post_tag'===$taxonomy)
      return $terms.', New Term';
   else
      return $terms;
}