• Resolved wuzhannanan

    (@wuzhannanan)


    I do not want to use the JS functionality on my site. Right now I have to go into each table individually and uncheck the boxes. Is there a way to mass-disable JS site-wide?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, this is possible with a small piece of code:

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

    Just add that to your theme’s “functions.php” or a small custom plugin and the JS features will be turned off for all tables, regardless of what the checkbox on the “Edit” screen is set to.

    Regards,
    Tobias

    Thread Starter wuzhannanan

    (@wuzhannanan)

    This works just as I wanted. Thank you so much.

    Plugin Author Tobias B?thge

    (@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 JS site-wide?’ is closed to new replies.