• Resolved pegasoazul2002

    (@pegasoazul2002)


    Hola,

    We have imported 189 tables and we need to disable some DATATABLES options for all tables, how can we do it?

    If we cannot disable some selected options, how can we completely disable DATATABLES in all the tables we have already done?

    It is important to be able to work with all the tables we have imported at the same time (189).

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The best way to disable these for all tables might be to use a filter hook function. For example, you can add this to the “functions.php” file of your theme:

    add_filter( 'tablepress_table_render_options', 'tp_turn_off_datatables', 10, 2 );
    function tp_turn_off_datatables( $render_options, $table ) {
      $render_options['use_datatables'] = false; // Turns off all DataTables functions.
      $render_options['datatables_sort'] = false; // Turns off sorting.
      $render_options['datatables_paginate'] = false; // Turns off pagination.
      return $render_options;
    }

    This example turns off DataTables for all tables on the site.
    Alternatively, it shows how to turn off individual things. For a list of the other values, see https://tablepress.org/faq/documentation-shortcode-table/ (all values that start with datatables_).

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Disable in all tables several DATATABLES functions’ is closed to new replies.