May 2017
Beginner to intermediate
536 pages
14h 25m
English
Apart from the custom columns, we need to have a column with a checkbox for every record in the list. This checkbox will be used to select the records and execute specific actions on the Bulk Actions drop-down menu. Let's consider the implementation using the column_cb function inside the template:
function column_cb($item) { return sprintf( <input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], $item['ID'] ); }
The first parameter in the preceding statement uses a singular label that we created inside the constructor to set the name of the checkbox as an array. The second parameter contains the ID for the row as defined in our dataset. This value should be the ID ...
Read now
Unlock full access