You need to add the code in functions.php file of the theme you're currently using; or the same file of the child theme (if you're using the child theme). The difference between child and original theme is that when you update the theme, all hooks from functions.php file will be deleted, whilst they will not be deleted in the child.
The data is being sent with the POST method, so you can use WordPress' hook the_content, where the data can be taken from the POST and forwarded to do_shortcode function. There, our shortcode can be placed with the placeholder %VAR1% like in the following example:
function test($content){
if (isset($_POST['wdt_details_data'])){
$detailsData= json_decode(stripslashes($_POST['wdt_details_data']), true);
$content .= do_shortcode('[wpdatatable id=1 var1='y']');
}
return $content;
}
You may just need to paste the placeholder in single quotes ( 'y' ).
I'm afraid I expressed myself poorly. In an already loaded page I have a button with which I would like to insert the result of an "echo do_shortcode("[wpdatatable id='1']") into an existing <div> in the page itself. By executing the ajax call with the php function that returns the table I obtain the complete table of all the data that I insert into the <div> with destj.html(response.responseText); The problem is that in this way I have the complete table but without formatting and without functions such as sort, insert etc. There's a way?
Can you please send us new credentials in a PRIVATE response, as the ones we have no longer work?
The function dest.html can't access the DOM elements, so the initialization of dt needs to be run. We can't say more about how this can be accessed without debugging the issue (which is why we need the credentials), but maybe this hint can help you in the meantime.
Unfortunately, our developers can't see anything through the code since these two files are just a part of a project. They said they would definitely need credentials for your website so they can see the behavior or debug the site because they can't figure anything out with the files previously provided.
If you're able to provide us with credentials, just remember to post them in a PRIVATE response.
OK, I try to make a user but now there is the problem that wpDataTables does not work due to the error: "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20480 bytes) in /home/u914431119/domains/resch.pro/public_html/wp-content/plugins/wpdatatables/lib/greenlion/php-sql-parser/ src/PHPSQLParser/utils/ExpressionToken.php on line 152". I'm waiting for provider support. However, the difficulty is not clear to me. An AJAX call with PHP function that calls shortcode and returns the wpDataTable to display shouldn't be that strange. Boh?
As for the memory limit that's exhausted - that can only be resolved by the hosting provider, so I hope they'll be able to increase the limit for your website.
The do_shortcode should work, as mentioned in one of my previous responses, which is why it's been escalated to our developers, so they can take a look. As soon as you send me the credentials (just mark the response as PRIVATE) I'll ask them to investigate.
I apologize, I was out yesterday. My developers weren't able to log in with the credentials you provided and when I tried them just now, it failed again.
Can you please provide me with valid admin credentials and we'll take a look?
I need to invoke a wpdatatable table with an ajax call from javascript.
With the do_shortcode() function it presents the table flat, without functionality and formatting.
How can it be done?
Hello Alessandro.
You need to add the code in functions.php file of the theme you're currently using; or the same file of the child theme (if you're using the child theme). The difference between child and original theme is that when you update the theme, all hooks from functions.php file will be deleted, whilst they will not be deleted in the child.
The data is being sent with the POST method, so you can use WordPress' hook the_content, where the data can be taken from the POST and forwarded to do_shortcode function. There, our shortcode can be placed with the placeholder %VAR1% like in the following example:
You may just need to paste the placeholder in single quotes ( 'y' ).
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Aleksandar,
I'm afraid I expressed myself poorly.
In an already loaded page I have a button with which I would like to insert the result of an "echo do_shortcode("[wpdatatable id='1']") into an existing <div> in the page itself.
By executing the ajax call with the php function that returns the table I obtain the complete table of all the data that I insert into the <div> with destj.html(response.responseText);
The problem is that in this way I have the complete table but without formatting and without functions such as sort, insert etc.
There's a way?
I'll have our QA team check this out and I'll get back to you as soon as I hear from them, Alessandro.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi again Alessandro.
Can you please send us new credentials in a PRIVATE response, as the ones we have no longer work?
The function dest.html can't access the DOM elements, so the initialization of dt needs to be run. We can't say more about how this can be accessed without debugging the issue (which is why we need the credentials), but maybe this hint can help you in the meantime.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
My problem is just how to do the initialization of the dt after the table has been returned in the ajax response.
I don't think debugging is very useful however I will send you the credentials.
Hi again Alessandro.
We can try, of course. Send me the code, and I'll ask our developers to inspect it.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thank you, Alessandro.
I forwarded this to our developers and as soon as I hear from them, I'll get back to you.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
no news?
Not yet, Alessandro, sorry for the delay.
I'll ask our developers to revisit this today.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi again Alessandro.
Unfortunately, our developers can't see anything through the code since these two files are just a part of a project. They said they would definitely need credentials for your website so they can see the behavior or debug the site because they can't figure anything out with the files previously provided.
If you're able to provide us with credentials, just remember to post them in a PRIVATE response.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
OK, I try to make a user but now there is the problem that wpDataTables does not work due to the error:
"Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20480 bytes) in /home/u914431119/domains/resch.pro/public_html/wp-content/plugins/wpdatatables/lib/greenlion/php-sql-parser/ src/PHPSQLParser/utils/ExpressionToken.php on line 152".
I'm waiting for provider support.
However, the difficulty is not clear to me. An AJAX call with PHP function that calls shortcode and returns the wpDataTable to display shouldn't be that strange. Boh?
Please tell me an email to create user.
Hi again Alessandro.
You can use my email address: [email protected]
As for the memory limit that's exhausted - that can only be resolved by the hosting provider, so I hope they'll be able to increase the limit for your website.
The do_shortcode should work, as mentioned in one of my previous responses, which is why it's been escalated to our developers, so they can take a look. As soon as you send me the credentials (just mark the response as PRIVATE) I'll ask them to investigate.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thank you, Alessandro, I forwarded this to our developers and I'll get back to you as soon as I hear from them.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
It seems to me that the problem is insurmountable.
Too bad because your plugin isn't that bad but I'll have to study DataTables on my own.
Hi again Alessandro.
I apologize, I was out yesterday. My developers weren't able to log in with the credentials you provided and when I tried them just now, it failed again.
Can you please provide me with valid admin credentials and we'll take a look?
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
It doesn't matter thanks.
I'm looking for the solution.
You can close the ticket.
Thank you for letting me know, Alessandro.
If you require any additional assistance from my end, please let me know.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables