Uses
| Uses | Description |
|---|---|
| wp-includes/taxonomy.php: get_term() | Get all Term data from database by Term ID. |
| wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Handles the link categories column output.
(object) (Required) The current link object.
File: wp-admin/includes/class-wp-links-list-table.php
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 );
} | Version | Description |
|---|---|
| 4.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_links_list_table/column_categories