apply_filters( “manage_{$this->screen->taxonomy}_custom_column”, string $string, string $column_name, int $term_id )

Filters the displayed columns in the terms list table.

Description

The dynamic portion of the hook name, $this->screen->taxonomy, refers to the slug of the current taxonomy.

Possible hook names include:

  • manage_category_custom_column
  • manage_post_tag_custom_column

Parameters

$stringstring
Custom column output. Default empty.
$column_namestring
Name of the column.
$term_idint
Term ID.

Source

return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Suppose you have a custom taxonomy called “genre”, replace {$this->screen->taxonomy} with the name of the custom taxonomy i.e. “genre”

    // Add info to the new columns
    add_action( 'manage_genre_custom_column', 'wpdocs_show_genre_meta_info_in_columns', 10, 3 );
    
    function wpdocs_show_genre_meta_info_in_columns( $string, $columns, $term_id ) {
        switch ( $columns ) {
            // in this example, we had saved some term meta as "genre-characterization"
            case 'characterization' :
                echo esc_html( get_term_meta( $term_id, 'genre-characterization', true ) );
            break;
        }
    }

    The sample below is for adding the column title in the same taxonomy.

    add_filter( 'manage_edit-genre_columns', 'wpdocs_add_new_genre_columns' );
    
    function wpdocs_add_new_genre_columns( $columns ) {
        $columns['characterization'] = __( 'Characterization' );
        return $columns;
    }

You must log in before being able to contribute a note or feedback.