Title: Use TablePress_Admin_Controller in another plugin
Last modified: May 22, 2022

---

# Use TablePress_Admin_Controller in another plugin

 *  Resolved [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/)
 * Dear,
    I’m trying to write a plugin that uses TablePress to show data (scoring)
   generated from a software.
 * From my software I can upload an HTML file to a server, my idea is to make an
   admin_post_nopriv target that receive as parameter the filename and the tableid
   to force an update of the tablepress that has the result stored inside.
 * To do this I would rely on _TablePress\_Admin\_Controller_ extending it, but 
   I don’t know how load it inside my plugin.
 * If I simply try to extend TablePress_Admin_Controller I got an error, even if
   the class extension is made after plugins are loaded or with wp_loaded.
    `add_action('
   plugins_loaded', function () { require_once('RegattaImporter.php'); });`
 * Inside RegattaImporter.php there is the class extension.
 * Can you help me?
 * Thanks

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15668107)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * I would not really recommend this approach. From what I understand, you are looking
   for an automatic import of data from an HTML file. For that, the TablePress Extension
   from [https://tablepress.org/extensions/table-auto-import/](https://tablepress.org/extensions/table-auto-import/)
   should be a better solution.
 * Regards,
    Tobias
 *  Thread Starter [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15668344)
 * Dear,
    I have an HTML file with many tables. I use information in other tag (
   h3, p) to determinate witch tablepress update and to modify the post where the
   table is show. So I need many customization, I read about auto-import but it 
   con assolve only partially my needs. I will give it a try but I need on-demand
   update and not programmatically and some pre-work to extract other information
   from the file.
 * Thanks.
    -  This reply was modified 4 years ago by [brambil](https://wordpress.org/support/users/brambil/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15668674)
 * Hi,
 * ok, I see. I’m not sure how you want to force the update then though, as TablePress
   will not be able to extract the table data from an HTML file with many tables…
   
   But of course feel free to investigate this further. The `plugins_loaded` hook
   is howewer too early, as TablePress only loads and initializes itself on the `
   init` hook. Please see the classes/class-tablepress.php file for this.
 * Regards,
    Tobias
 *  Thread Starter [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15669416)
 * My HTML is an output from a scoring software, so I know how is formatted.
 * Each table is inside a div, in each div there is an <heading>, a <p> and the 
   table.
    My script will explode the html, for each div extract heading and p information
   that I will use to update post and identify the tablepress id to update, finally
   I will pass all the code to tablepress to work on the table.
 * I will investigate the code and share the solution. Maybe it could be useful 
   for other people who use the same scoring software.
    -  This reply was modified 4 years ago by [brambil](https://wordpress.org/support/users/brambil/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15669941)
 * Hi,
 * what is your goal with TablePress here, actually? Are you trying to do this so
   that you can add the JavaScript features to your tables (sorting, searching, 
   pagination, …)? If yes, it might be much easier to just manually load the DataTables
   JS library from [https://datatables.net/](https://datatables.net/) into your 
   site. (That’s the library that TablePress uses for these features.)
 * Regards,
    Tobias
 *  Thread Starter [brambil](https://wordpress.org/support/users/brambil/)
 * (@brambil)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15670224)
 * Thanks.
 * It could be an options, but my goal is also integrate tables in my WP Posts.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15672698)
 * Hi,
 * ah, ok. Then, directly using DataTables will indeed not help. I hope that you
   can find a good solution with TablePress then!
 * Best wishes,
    Tobias

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

The topic ‘Use TablePress_Admin_Controller in another plugin’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/use-tablepress_admin_controller-in-another-plugin/#post-15672698)
 * Status: resolved