Feature request: additional filters/hooks
-
Hi there,
First of all – FANTASTIC plugin. Love it! Thanks for all your hard work.
Secondly, I have what I think is a pretty simple feature request, which entails adding a few hooks/filters to the
handle_post_action_edit
function in controller-admin.php.At present, it’s very difficult to add custom metaboxes and save associated data on a per-table basis (for example, say I want to add a custom metabox on the edit table screen for something like “Show table on tablet screen sizes”). At present, you manually specify the checkboxes and fields to be parsed on save, however if you were to pass these values through a filter and/or call a few actions, this would allow users to very easily save custom data as well. For example, line 720 defines the checkboxes that will be parsed:
$checkbox_options = array(...)
If you were to then pass this through a filter like so:
$checkbox_options = apply_filters( 'tablepress_checkbox_options_to_save_on_edit', $checkbox_options, $edit_table );
. . . this would allow users to easily add their own checkbox options.
Alternately, if you want to keep things more generic, then you could simply pass the full
$edit_table
array through a filter before saving, as this would allow users to customize it as they see fit, running their own custom functionality to add/remove/edit options, which could be very handy. In fact, this might be the simplest fix, just adding the following on line 729:$edit_table = apply_filters( 'tablepress_edit_table', $edit_table );
Any chance you could take a look and see if this makes sense to implement? Thanks!
- The topic ‘Feature request: additional filters/hooks’ is closed to new replies.