Hello i filtered some datas upon a product id from a table and want to insert a new record whose default value would be the current filter productid; is there a way to do that ?
I am sorry to disappoint you, but unfortunately, something like this is not possible with the plugin's built-in features.
Predefined editing values are fixed, and they can't be picked up from the filter using the plugin's built-in features. You would need to create a custom solution that would pull this data and apply it in the form.
We do not provide support for custom solutions, so we can't help you in this case.
ok one easy way would be to affect a cookie value to placeholder %var1% since a placeholder can be used as a default value in a field any idea about that ?
At the moment, you can only use the hook for placeholders, where the value of the placeholder will execute a do_shortcode of that custom shortcode, and it should return the data:
function updateVAR1($tableID){ global $wdtVar1; //check for specific table if($tableID == 1){ //get value from that shortcode $wdtVar1 = do_shortcode('[ep]'); } } add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');
Just make sure to replace the ID of the table so it matches your table ID.
Hello i filtered some datas upon a product id from a table and want to insert a new record whose default value would be the current filter productid; is there a way to do that ?
thanks for help !
Regis
Hello Regis
I am sorry to disappoint you, but unfortunately, something like this is not possible with the plugin's built-in features.
Predefined editing values are fixed, and they can't be picked up from the filter using the plugin's built-in features. You would need to create a custom solution that would pull this data and apply it in the form.
We do not provide support for custom solutions, so we can't help you in this case.
Sorry for the inconvenience.
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 one easy way would be to affect a cookie value to placeholder %var1% since a placeholder can be used as a default value in a field any idea about that ?
thanks again
'ep' refers to a user number in a context where we don't want users to be registred in wp so
%CURRENT_USER_ID% is not available
for exemple we could define a snippet like this :function ep() {
$ep = $_COOKIE['ep'];
return $ep;
}
// Add a shortcode
add_shortcode('ep', 'userid');
add_action('init', 'ep');
this snippet creates a shortcode reffering to the value of the cookie
Can this shortcode be embedded in wpdatatable shortcode like this ?
[ wpdatatable id=12 var1=[ep]]
this way datas will be filtered by 'ep' and new rows value ep can be set default %var1% placeholder.
Hey regis
I forwarded this ticket to one of our developers, so I'll get back to you as soon as I hear from him.
Thank you for your patience, and sorry for the delay!
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
Hello again regis.
At the moment, you can only use the hook for placeholders, where the value of the placeholder will execute a do_shortcode of that custom shortcode, and it should return the data:
Just make sure to replace the ID of the table so it matches your table ID.
I hope this helps.
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