WordPress at Your Fingertips
function is not described

WP_Links_List_Table::column_categories() public WP 4.3.0

Handles the link categories column output.

{} It's a method of the class: WP_Links_List_Table{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Links_List_Table = new WP_Links_List_Table();
$WP_Links_List_Table->column_categories( $link );
$link(object) (required)
The current link object.

Notes

  • Global. Int. $cat_id

Changelog

Since 4.3.0 Introduced.

Code of WP_Links_List_Table::column_categories() WP 5.8.2

public function column_categories( $link ) {
	global $cat_id;

	$cat_names = array();
	foreach ( $link->link_category as $category ) {
		$cat = get_term( $category, 'link_category', OBJECT, 'display' );
		if ( is_wp_error( $cat ) ) {
			echo $cat->get_error_message();
		}
		$cat_name = $cat->name;
		if ( (int) $cat_id !== $category ) {
			$cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
		}
		$cat_names[] = $cat_name;
	}
	echo implode( ', ', $cat_names );
}