Nick McBurney
Member
Posted 7 months ago #
Hi,
Just wondering if it would be possible to change the default options for tables e.g. if would be preferential for me to have all the options un-ticked except 'Row Hover Highlighting'.
Im quite comfortable editing code and could just do with knowing what I need to change.
Thanks in advance.
Nick
http://wordpress.org/extend/plugins/tablepress/
Hi Nick,
thanks for your question.
Yes, something like this is possible by using a filter hook to set new default values. You will need the latest version from the "master" branch from the GitHub repository at https://github.com/TobiasBg/TablePress (or wait for TablePress 0.7-beta, which will be out some time next week).
After that, you can create a small plugin from the following code (or paste it into your theme's "functions.php"):
add_filter( 'tablepress_table_template', 'tablepress_change_default_values' );
function tablepress_change_default_values( $default_table ) {
$default_table['options']['table_head'] = false;
$default_table['options']['table_foot'] = false;
$default_table['options']['alternating_row_colors'] = false;
$default_table['options']['row_hover'] = true;
$default_table['options']['print_name'] = false;
$default_table['options']['print_description'] = false;
$default_table['options']['use_datatables'] = false;
return $default_table;
}
Regards,
Tobias