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 #2447356
wpdatatables_filter_formdata_before_save missing in the documentation
Closed

Comments

  •  1
    Piotr Kowalski started the conversation

    wpdatatables_filter_formdata_before_save exists in the wdt_ajax_actions.php file but is not described in the documentation. While is really helpful when you need to add auto timestamp for example.

    If someone need such function can grab some code:

    function timestamp_for_wpdatatables ( $formdata, $tableId ) {   

        $columnsData = WDTConfigController::loadColumnsFromDB($tableId);
         foreach ($columnsData as $column) {
             if ($column->orig_header == "timestamp") {
                     $formdata["timestamp"] = date("Y-m-d H:i:s");
             }elseif ($column->orig_header == "created" && get_query_var('new_created_for_wpdatatables') == true) {
                    $formdata["created"] = date("Y-m-d H:i:s");
             }

         }    
        return $formdata;
    }
    add_filter('wpdatatables_filter_formdata_before_save', 'timestamp_for_wpdatatables',10,2);

    function created_for_wpdatatables ( $formdata, $tableId ) {

        if ($formdata['wdt_ID'] == '') {
            set_query_var('new_created_for_wpdatatables', true);
        }
        return $formdata;
    }
    add_filter('wpdatatables_filter_frontend_formdata', 'created_for_wpdatatables',10,2);

    This can auto-increment datetime into columns with headers "timestamp" or "created"

  •  471
    Isidora replied

    Hi Piotr,
    Thank you for your purchase.

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    Yes there are more filters in hooks that is added recently, and we have to update our dev docs for actions and filters. Thank you for sharing this code. We will provide it to other customer who will need this functionality.

    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