You should first check, and then assign your custom column.
$column
should really be $columns
to convey the real meaning, as it’s an array.
So, you need to check if the array key exists before the assignment with something like isset()
or array_key_exists()
.
Finally, since your site_title_column()
function modifies the value of a filter, you should always return a value (usually the original, perhaps modified), as simply calling return;
returns NULL
(which is rarely what’s needed).
I’d rewrite your function as such:
function site_title_column( $columns ) {
if ( ! isset( $columns['views'] ) ) {
$columns['views'] = 'Title';
}
return $columns;
}