WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Table Options - Changing Default Options (2 posts)

  1. Nick McBurney
    Member
    Posted 1 year 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/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags