• Resolved techie995

    (@techie995)


    Hi, I have 10000 tables that is default configured with “Enable sorting of the table by the visitor.” How can I disable this setting on 10000 tables without having to manually click edit 10000 and un-checking them?

    • This topic was modified 6 years, 8 months ago by techie995.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Your best option then probably is to turn the sorting off for all TablePress tables using a filter hook. For example, add this to the theme’s “functions.php” file:

    add_filter( 'tablepress_table_render_options', 'techie995_tablepress_turn_off_sorting', 10, 2 );
    function techie995_tablepress_turn_off_sorting( $render_options, $table ) {
      $render_options['datatables_sort'] = false;
      return $render_options;
    }

    With this, the state of the checkbox will be ignored, and sorting will always be off.

    Regards,
    Tobias

    Thread Starter techie995

    (@techie995)

    Hi Tobias, Thanks for your fast response! The code worked, saved me lots of time. 🙂

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable Sorting of table for 10000 tables’ is closed to new replies.