Okay
  Public Ticket #1943112
New Entry Hook
Closed

Comments

  •  1
    Uriahs started the conversation

    When a new row is added on the front end I want to grab the data(preferably an array with the table headers as the key) that was entered somehow so I can do some work with it in PHP.

    Is there a hook for this?

    Example use case:

    I want the stock keeping department to only enter their a unique User identifier which they will get on all packages they receive in the warehouse.

    On their dashboard(stock keeping employees), they'll only have to enter this user identifier in the frontend table. 

    In PHP, I will grab that user identifier(using the Hook) and match it against another table so that I can grab some data automatically that the stock keeping department would otherwise have to enter themselves; which would make their work more efficient. 

    I had a look at your hooks page but I can't find the any that would allow this: https://wpdatatables.com/documentation/information-for-developers/hooks/

    The closest i found was wpdatatables_after_frontent_edit_row( $formdata, $rowId, $tableId ) but this is for after editing a row and not for a new entry

  •  472
    Isidora replied

    Hi TheLoneDev,
    Thank you for your interest in wpdatatables.

    This hook wpdatatables_after_frontent_edit_row will be triggered for both cases when you edit or adding a new row in the table from front-end. Please note that data is already saved in database.

    If you what to filter data before saving in database then yo can use filter wpdatatables_filter_formdata_before_save($formData, $tableId)

    It is one of the new filters, so it will be updated in our documentation.

    Best regards.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables