I'm using the mbct_{$this->model->name}_column_output filter to modify the output of a column for a custom model, however, the modified output is not displaying in the admin list table. Do you know why that might be?
Here is my code:
/**
* Modify the output of the 'title' column for the 'import' custom model to include the 'edit' link.
*
* @param mixed $output Column output.
* @param string $column_name Column name.
* @param array $item Item data.
* @param object $model Model instance.
*
* @return mixed Modified column output.
*/
add_filter('mbct_import_column_output', 'bcc_modify_title_column_output', 10, 4);
function bcc_modify_title_column_output($output, $column_name, $item, $model) {
if ($column_name === 'title') {
$base_url = admin_url("admin.php?page=model-import");
$edit_url = add_query_arg([
'model-action' => 'edit',
'model-id' => $item['ID'],
], $base_url);
// Make the title a link to the 'edit' page.
$output = sprintf('<a href="%s">%s</a>', esc_url($edit_url), esc_html($output));
}
return $output;
}