I have my CPT edit screen almost looking how I want it but want to remove the filter and view options from this screen as they are not needed for this interface. How do I remove them? Are there any filters that disable them?
My edit screen has got to this stage by this code so far:
// Manage columns in edit screen
add_filter('manage_edit-staff_columns', 'sc_staff_modify_columns');
function sc_staff_modify_columns($staff_columns) {
$staff_columns['title'] = __('Staff Name', 'sc_wilsons_custom');
$staff_columns['job_role'] = __('Job Role', 'sc_wilsons_custom');
$staff_columns['is_store_manager'] = __('Store Manager', 'sc_wilsons_custom');
$staff_columns['located'] = __('Located At', 'sc_wilsons_custom');
unset($staff_columns['date']);
return $staff_columns;
}
add_action('manage_staff_posts_custom_column', 'sc_staff_manage_columns', 10, 2);
function sc_staff_manage_columns($column_name, $id) {
global $wpdb;
$custom = get_post_custom($id);
switch ($column_name) {
case 'job_role':
echo $custom["sc_staff_job_role"][0];
break;
case 'is_store_manager':
echo ($custom["sc_staff_store_manager"][0] == 1) ? __('Yes', 'sc_wilsons_custom') : __('No', 'sc_wilsons_custom');
break;
case 'located':
if(is_int($custom["sc_staff_located"][0])){
$post = get_post($custom["sc_staff_located"][0]);
echo $post->post_title;
} else {
_e('Unknown', 'sc_wilsons_custom');
}
break;
}
}
EDIT: if it helps I have found where the code for these bits are generated. Functions months_dropdown()
and view_switcher
in file /wp-admin/includes/class-wp-list-table.php
I don't see any filters or hooks here so might be out of luck. Anyway of doing this by extending the WP_List_Table class?