WP_Terms_List_Table::column_cb() WordPress Method
The column_cb() method is used to generate the checkbox column for the terms list table. This method is called when the 'cb' column is added to the terms list table. The 'cb' column is the checkbox column, which is used to select terms for bulk actions. The column_cb() method accepts two parameters: $term - The term object $column_name - The name of the column The column_cb() method outputs the checkbox for the term.
WP_Terms_List_Table::column_cb( WP_Term $item ) #
Parameters
- $item
(WP_Term)(Required)Term object.
Return
(string)
Source
File: wp-admin/includes/class-wp-terms-list-table.php
public function column_cb( $item ) { // Restores the more descriptive, specific name for use within this method. $tag = $item; if ( current_user_can( 'delete_term', $tag->term_id ) ) { return sprintf( '<label class="screen-reader-text" for="cb-select-%1$s">%2$s</label>' . '<input type="checkbox" name="delete_tags[]" value="%1$s" id="cb-select-%1$s" />', $tag->term_id, /* translators: %s: Taxonomy term name. */ sprintf( __( 'Select %s' ), $tag->name ) ); } return ' '; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |