Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2197758
Changing table field after frontend editing
Closed

Comments

  • Caroline started the conversation

    Hi,

    we have a table within our customer portal, where customers can create new rows in.

    One of the fields within the table is "status" (not visible in frontend) that can have numeric values of 0-9. These values are used for external scripts that query the database on a scheduled base.

    Now, we have two questions:

    • In case, the customer creates a new row in the table, we’d like to programmatically set the value of “status” to “1”.
    • In case, the customer edits an existing row, we’d like to programmatically set the value of “status” to “2”.

    We tried the first part with the following code but with no success:

     

    add_action( 'wpdatatables_after_frontent_edit_row','CKI_edit_passenger', 10, 3);

    function CKI_edit_passenger($formdata, $rowId, $tableId) {

                  if ($rowId = null) {

                                $formdata['status'] = 1;

                  }

    }

  •  2,498
    Aleksandar replied

    Hello Caroline.

    I am sorry to disappoint you, but unfortunately something like this is not possible with the plugin's built-in features.

    You can set the predefined value for a column to be "1", but there's no way of letting the plugin know to change it to "2" when someone edits the row. Not with the built-in features, that is. I see that you already checked our hooks, and that's the correct way to go. Unfortunately something like this would fall under customization of the plugin, and there's nothing I can do to help here.

    It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in near future.

    But we can recommend these services for customization:

    https://codeable.io/?ref=l1TW1

    https://wpkraken.io/?tms-plugins

    They do develop such solutions, so can you please send your inquiry to them?

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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