WP_Terms_List_Table::column_default() WordPress Method

The WP_Terms_List_Table::column_default() method is used to display the default column value for a given term in the terms list table. This method is called for each term in the list table, and is passed the term object and the column name. It should return the value to be displayed in that column for the given term. The default columns are 'name', 'slug', and 'posts'. Other columns can be added by hooking into the 'manage_terms_custom_column' action.

WP_Terms_List_Table::column_default( WP_Term $item, string $column_name ) #


Parameters

$item

(WP_Term)(Required)Term object.

$column_name

(string)(Required)Name of the column.


Top ↑

Return

(string)


Top ↑

Source

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

	public function column_default( $item, $column_name ) {
		/**
		 * Filters the displayed columns in the terms list table.
		 *
		 * 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`
		 *
		 * @since 2.8.0
		 *
		 * @param string $string      Custom column output. Default empty.
		 * @param string $column_name Name of the column.
		 * @param int    $term_id     Term ID.
		 */
		return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.