Title: Adding dataTables Extensions
Last modified: April 30, 2020

---

# Adding dataTables Extensions

 *  Resolved [Judson Mitchell](https://wordpress.org/support/users/judsonmitchell/)
 * (@judsonmitchell)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/adding-datatables-extensions/)
 * Thanks for this fabulous plugin! It’s really well done. I’m trying to add the
   dataTables buttons extension to my table. Is the only way to do this by editing
   class-wp-data-access-public.php and registering the script? Or is there a simpler
   way?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12762396)
 * Welcome Mitchell! 🙂
 * Good question! You need to put that code “somewhere”. I would not advise to add
   it to a plugin or theme file as your code will be lost when you update. You can
   create your own plugin file and put it into the plugin directory. At least you
   don’t need to worry about updates then. Is there anyone else who has a better
   idea? I hope to launch the Code Manager soon. This is a plugin extension (not
   free) which solves this issue.
 * BTW, here is a discussion about adding the buttons extensio which you might find
   useful:
    [https://wpdataaccess.com/docs/documentation/data-publisher/advanced-settings/#comments](https://wpdataaccess.com/docs/documentation/data-publisher/advanced-settings/#comments)
 * Hope this helps…
 * Best regards,
    Peter
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [6 years ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12788735)
 * Hi Mitchell,
 * Did you succeed in adding a DataTables extension? Can I close this topic?
 * Thanks,
    Peter
 *  Thread Starter [Judson Mitchell](https://wordpress.org/support/users/judsonmitchell/)
 * (@judsonmitchell)
 * [6 years ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12823877)
 * Thanks for checking in on this Peter! I think I did basically get it going. I
   created a new plugin and created this function:
 *     ```
       function add_dataTables_buttons(){
          wp_enqueue_style('jquery_datatables_buttons', '//cdn.datatables.net/buttons/1.6.1/css/buttons.dataTables.min.css'); 
   
          wp_enqueue_script( 
             'jquery_datatables_buttons',
             '//cdn.datatables.net/buttons/1.6.1/js/dataTables.buttons.js',
             array('jquery','jquery_datatables','jquery_datatables_responsive'),
             false,
             true
          );
       }
   
       add_action( 'plugins_loaded', 'add_dataTables_buttons', 12,0 );
       ```
   
 * This loads up the css and js for buttons in the right order. Unfortunately, I’ve
   had to hard code the version because I don’t know how to get your global WPDA::
   OPTION_WPDA_DATATABLES_VERSION in my function. If you have any suggestions, it
   would be appreciated.
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [6 years ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12825120)
 * Hi Mitchell,
 * You can add the version number hard coded. That’s okay. The plugin uses a variable,
   but there is no way to change the value of the variable… 🙈 So effectively, it’s
   a kind of hard coded variable? 😑 I might make this variable editable some day…
 * Best regards,
    Peter
 *  Thread Starter [Judson Mitchell](https://wordpress.org/support/users/judsonmitchell/)
 * (@judsonmitchell)
 * [6 years ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12828144)
 * Perfect. In case anybody needs this in the future, I put together a Github repo
   with the code: [https://github.com/judsonmitchell/wp-data-access-buttons](https://github.com/judsonmitchell/wp-data-access-buttons)
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [6 years ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-12831768)
 * Thank you so much Mitchell! 🙂
 * I’ll add a link to the plugin website.
 * Great! 🙂
    Peter
 *  [YuppiDu](https://wordpress.org/support/users/andreavecchi71/)
 * (@andreavecchi71)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-13130273)
 * Hi Mitchell, I’m interested in testing your plugin 😉
 * If I understood correctly by reading your documentation, it seems that it works
   only with “WPDA publications” (not on “WPDA data-projects”), am I right?
 * BTW, the goal that I want to reach is to show a table, having records ordered
   in a certain way (_not_ the insertion order) and would like to add a simple “
   add new record” button on-top of the table.
 * I think that I could simply use a “WPDA publication” (pointing to a pre-ordered
   database view) and add the a.m. button on-top of it, by using your plugin.
 * I’m forced to implement this “trick” because I cannot – in this moment – set 
   a _custom ordering_ in a “WPDA data-project” table.
 * I would really appreciate a small tutorial to reach the goal that I described,
   which could be interesting also for other developers.
 * TKS in advance!
 *  [YuppiDu](https://wordpress.org/support/users/andreavecchi71/)
 * (@andreavecchi71)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-13134970)
 * **WARNING:** I installed the plugin for testing purpose, I didn’t touch any of
   my publications (I didn’t add any JSON to any “advanced table options”) and… 
   all of them was not visible anymore on my website…
 * Maybe there’s a kind of incompatibility with the latest version(s) of the WPDA
   plugin…
 *  Thread Starter [Judson Mitchell](https://wordpress.org/support/users/judsonmitchell/)
 * (@judsonmitchell)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-13136098)
 * The plugin is only designed to work for Data Publisher. As far as I know, Data
   Projects does not afford you the opportunity to add custom JS to its views.
 * The plugin is still working for me using v3.1.5 of WPDA (Publisher). I would 
   suggest open up Developer Tools and sharing with us whatever errors you see in
   the console.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Adding dataTables Extensions’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

## Tags

 * [buttons](https://wordpress.org/support/topic-tag/buttons/)
 * [extensions](https://wordpress.org/support/topic-tag/extensions/)

 * 9 replies
 * 3 participants
 * Last reply from: [Judson Mitchell](https://wordpress.org/support/users/judsonmitchell/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/adding-datatables-extensions/#post-13136098)
 * Status: resolved