On this page
WP_Terms_List_Table::single_row( WP_Term $tag, int $level )
Parameters
$tagWP_Term Required-
Term object.
$levelint Required
Source
File: wp-admin/includes/class-wp-terms-list-table.php. View all references
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>';
}
Related
Uses
| Uses | Description |
|---|---|
| get_ancestors() wp-includes/taxonomy.php | Gets an array of ancestor IDs for a given object. |
| sanitize_term() wp-includes/taxonomy.php | Sanitizes all term fields. |
Used By
| Used By | Description |
|---|---|
| WP_Terms_List_Table::display_rows_or_placeholder() wp-admin/includes/class-wp-terms-list-table.php | |
| WP_Terms_List_Table::_rows() wp-admin/includes/class-wp-terms-list-table.php |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_terms_list_table/single_row