Plugin menu #
Panel cookies are used to save settings like your currently selected database and search criteria. Panel cookies are cleared after one hour.
When set to Clear when switching panels, the plugin clears these cookies every time the user switches to another page. When set to Keep when switching panels, cookies are preserved when the user switches to another page.
Secret key and IV #
Enter any prase to secure your remote database connection information. When set, all current remote database connections will be converted immediately.
Remote database connections #
Edit or delete remote database connections.
Shortcode wpdataaccess #
Grant access to shortcode for posts and/or pages.
Shortcode wpdadiehard #
Grant access to shortcode for posts and/or pages.
Shortcodes wpdadataforms and wpdadataprojects #
Grant access to shortcode for posts and/or pages.
Debug mode #
With debug enabled:
- Data Forms displays debug messages in the browser console
- Query information is added to Data Tables responses
- A button is added to the Data Projects main page to check project settings
Date format #
Output format cannot be changed here. Please use the WordPress settings (Settings > General) page to change the output format.
Select a predefined input format or enter a custom one and adjust the placeholder.
Time format #
Output format cannot be changed here. Please use the WordPress settings (Settings > General) page to change the output format.
Select a predefined input format or enter a custom one and adjust the placeholder.
Date/time test #
Click on the button to test if your setting work before you save!
Set format #
List format for data type set only
I have been using your plugin with great joy!
I have run into one issue I can’t seem to fix.
In my database, dates are stored as a UNIX timestamp, and I was hoping to setup the table to show the date converted into something readable. Is this possible? I can for some reason not find it.
A bonus question would be, can we do conditioned formating. Say if its a row has 1 in the database you display a checkmark picture or something 🙂
Kind regards
Hi Nickolai,
>>> In my database, dates are stored as a UNIX timestamp
Is this a MySQL date(time) column? Or is the date inserted into a varchar column? You cannot (re)format a date if it is stored in a varchar column. But you should be able to format your date field on the plugin settings page.
Can you send me some screenshots? I’m interesed in your table structure and the layout of your data. You can use the contactform to send me your screenshots in private.
Thanks,
Peter
Hi Peter,
Your app is just about the perfect solution, however I was not able to find one solution.
Is there a way to hook into your program to reformat the outputted data on the front-end table? For example, a price column is stored in my database as an int value of 10000, which means $100.00, and I would like it displayed like that. Is there a way to hook into your program, (PHP hook or JavaScript) so I can write a function with an input of 10000 from the DB returns $100.00 and displays that way in the front-end table? Thank you.
Hi Cory,
Yes, you can hook into the plugin! 🙂
To reformat data with Data Tables, you can use function fnRowCallback in advanced settings. Here is an example:
https://wpdataaccess.com/docs/data-tables-advanced-features/advanced-settings/
To reformat data with Data Projects, you can use filter wpda_column_default. Here is the (minimal) documentation:
https://wpdataaccess.com/docs/filters/wpda_column_default/
Let me know if you need help!
Best regards,
Peter
Thank you very much Peter, I’m on the right path now! Here are the solutions I came up with both have good results but I need a little more help with Data Tables for the different views.
For Data Tables, here is a solution, however I have to continually map the column number (in this example 3). If I change the column placement or more importantly change it to the responsive view, this breaks. Is there a way to map it by name of the column instead of the number, or change the output for all views? Not sure if it’s possible, but I’d prefer a PHP hook solution for Data Tables:
{ “fnRowCallback”: “function(row, data, index) { var amount = data[3] / 100; var dollar = ‘$’ + amount.toFixed(2).toString(); jQuery(row).find(‘td:eq(3)’).html(dollar); }” }
For the Data Projects I copied your example function, and added a little bit to it. (Note: in the example function you have a “$this” parameter that throws an error, did you mean for that to be “$self”?). Anyway, this function works for me:
function my_column_default(
$value,
$item,
$column_name,
$table_name,
$schema_name,
$wpda_list_columns,
$list_number
) {
if ( ” !== $value ) {
return $value;
}
if ( ‘dutch’ === $column_name ) {
return ‘NL-‘ . $item[ $column_name ];
}
if ( ‘transaction_amount’ === $column_name ) {
return ‘$’.number_format(($item[ $column_name ] / 100), 2, ‘.’, ”);
}
}
add_filter( ‘wpda_column_default’ , ‘my_column_default’ , 10 , 8 );
This is perfect! I’m not sure if this is the correct way to do it but it gives the right output. I was initially trying to use $value but it appeared empty when I did the console.log($value) output. This works so I’m happy with it. Thank you for all your help!
Hi Cory,
You are right, parameter $this needs to be $self. Thank you for reporting! I updated the code.
Data Tables uses the column sequence number, not the column name. Right again! 🙂 This has a number of advantages, but I understand your need to use the column name. I added your comment to my to do list.
Thank you for sharing your solution! 🙂
Peter
Thank you Peter, again great program, I’ll be looking forward to that update!
I’ve moved my site from GoDaddy to SiteGround. Since the move my WPDA publications aren’t working… I’m not connecting to my remote database. I see that the Settings/Plugin/Secret Key and IV are not populated but I don’t know if they were at GoDaddy.
Please help.
Hi Mike,
You can find your remote database connections in your options table, option name = wpda_remote_databases. Please be aware that these values are hashed. To make them available on your new server, you need to copy your old secret key and iv to your new server BEFORE you copy the wpda_remote_databases option. You can also just add the remote connection from the Data Explorer.
Hope this helps,
Peter
HI! i need your help, i have a time field in my database it contains a determinate value.. in table builder convert this value in a hour of day
Hi Andres,
The only way to convert this value is to use a query for your data table. If you’re a premium user, you can use a custom query as your data source. 🙂
Hope this helps! If you have more questions, please send us a message using our contact page.
HI! I want to save data accoding to user how is signed up and want to show data to user who added that data . How can i achieve that
Hi Gulfam,
Looks like we totally missed your question. So sorry…
You can access your WordPress user id in SQL using a session variable. The is explain here:
https://wpdataaccess.com/docs/variable/wordpress-user-id-in-sql/
Please accept my apologies for the delayed response,
Peter