Uses
| Uses | Description |
|---|---|
| wp-includes/taxonomy.php: get_ancestors() | Get an array of ancestor IDs for a given object. |
| wp-includes/taxonomy.php: sanitize_term() | Sanitize Term all fields. |
(WP_Term) (Required) Term object.
(int) (Required)
File: wp-admin/includes/class-wp-terms-list-table.php
public function single_row( $tag, $level = 0 ) {
global $taxonomy;
$tag = sanitize_term( $tag, $taxonomy );
$this->level = $level;
if ( $tag->parent ) {
$count = count( get_ancestors( $tag->term_id, $taxonomy, 'taxonomy' ) );
$level = 'level-' . $count;
} else {
$level = 'level-0';
}
echo '<tr id="tag-' . $tag->term_id . '" class="' . $level . '">';
$this->single_row_columns( $tag );
echo '</tr>';
}
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_terms_list_table/single_row