1. Home
  2. Docs
  3. Index
  4. Demos and Tutorials

Demos and Tutorials

Articles

Was this article helpful to you? Yes No

4 Replies to “Demos and Tutorials”

  1. Hello Peter,

    You have a public hook
    $this->loader->add_action( ‘wp_ajax_wpda_datatables’, $plugin_datatables, ‘get_data’ );
    Is there easy way to override get_data outside your plugin in my plugin for example,.
    Do I have to recreate all of this:
    use WPDataAccess\Data_Dictionary\WPDA_Dictionary_Exist;
    use WPDataAccess\Data_Dictionary\WPDA_List_Columns_Cache;
    use WPDataAccess\Plugin_Table_Models\WPDA_Publisher_Model;
    use WPDataAccess\Plugin_Table_Models\WPDA_Media_Model;
    use WPDataAccess\WPDA;

    Can you give me some tips?

    Thank you,
    Anatoly

  2. Hi Anatoly,

    Interesting question! Yes, you can…

    First make sure WP Data Access is loaded. You can use the plugins_loaded hook:
    add_action(‘plugins_loaded’, ‘your-function-goes-here’);
    This ensures you have access to the WP Data Access namespaces and classes.

    Next step is to create your own sub class for WPDA_Data_Tables and overwrite method get_data.

    Finally you have to create your own public hook. The WP Data Access hook uses class WPDA_Data_Tables. You have to make sure your hook calls your class.

    My advise would be to create a sub class without changing any code first, add your own hook and test it. Ones you have that working you can start rewriting the get_data method.

    I hope this helps! Let me know if you need assistance. It would be great if you could share your code ones it works.

    Best regards,
    Peter

  3. Hello Peter,

    I know very little about SQL databases.

    I am trying to export certain taxonomies called Locations and bulk add thousand of locations back into the wordpress site.

    I have searched high and low and I have not found anything plugin that would suffice.

    I think your plugin would do the job, however, I have no idea how to make this happen or even where to start.

    If you are feeling generous and can assist in pointing me in the right direction, that would be really handy.

    Best regards,

    Gerard

  4. Hi Gerard,

    Let’s presume your table is named Locations. To export your table:
    – Login the WordPress dashboard of your source machine
    – Navigate to WP Data Access main menu
    – Search table Location in the Data Explorer
    – If you hover over the table name you’ll see a link Manage
    – Click on that link
    – Click on button EXPORT (select SQL and disable all checkboxes)

    Your export is written to a SQL file. To import the file on the target machine:
    – Login the WordPress dashboard of your target machine
    – Navigate to WP Data Access main menu
    – Click on button Import data/Execute script(s)
    – Select the export file you have previously created
    – Uncheck hide errors
    – Click on button Import file/Execute script(s)
    – Check your errors if there are any

    Your table should now be on the target machine. Hope this helps Gerard! 🙂

    Best regards,
    Peter

Leave a Reply to Gerard Willett Cancel reply

Your email address will not be published. Required fields are marked *