Remove some content from Edit Table screen
-
First, thanks for the excellent plugin!
I’m using WordPress 4.3.1 and TablePress 1.6.1 in a dev environment that’s not publicly accessible.
We have custom styles and datatables behavior for tables on the non-Wordpress portion of our site that we are now carrying over to the WordPress-powered blog, so we want to prevent loading of the TablePress default styles, add some classes by default to all tables created via TablePress, and hide some options on the Edit Table page.
I’ve been able to take care of the first couple using the filter hooks
tablepress_use_default_css
andtablepress_table_css_classes
These are the parts of the edit screen I’m trying to remove:
https://dl.dropboxusercontent.com/s/xtneimqz9e9pbhy/2015-09-23%20at%2012.18%20PM.pngIn looking at the postbox_table_options function in view-edit.php, it seems like removing “Alternating Row Colors” and “Row Hover Highlighting” isn’t possible without editing the plugin code directly. Maybe a workaround is to hide them via css? (not ideal, I know).
It does seem like I should be able to remove the DataTables part though, since it’s added with add_meta_box. I’ve been trying to get that work (and searched for others with similar issues) but haven’t been able to get it working. Here’s my latest (non working) attempt:
add_action( 'do_meta_boxes', 'remove_tablepress_plugin_metaboxes' );
function remove_tablepress_plugin_metaboxes() {
remove_meta_box( 'tablepress_edit-datatables-features', 'post', 'normal' );
}
I can’t tell if that code isn’t working because of when it’s called (do_meta_boxes), if it needs a more specific post type than ‘post’, if the ID of the box I want to remove isn’t correct, or if it’s something else entirely.
Many thanks in advance to anyone who can point me in the right direction!
- The topic ‘Remove some content from Edit Table screen’ is closed to new replies.