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 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

Top ↑

Parameters Parameters

$string

(string) Blank string.

$column_name

(string) Name of the column.

$term_id

(int) Term ID.


Top ↑

Source Source

File: wp-admin/includes/class-wp-terms-list-table.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by laurencebahiirwa

    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;
    }
    

Top ↑

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