This filter runs on the value that gets saved for the custom field (what gets passed to update_post_meta()).


(string) Field value from the form.
(string) Custom field meta key.
(int) Field ID.
(array) Sanitized entry field values/properties.
(array) Processed form settings/data, prepared to be used later.



More Information

The wpforms_post_submissions_process_meta filter can be used to change the value of a saved field from the Post Submissions Addon.


Below is an example snippet with this filter that will change the post_meta save to use the UNIX timestamp.

 * Customize post_meta value during WPForms Post Submissions processing.
 * @link
 * @param  string  $field_value  Field value from the form.
 * @param  string  $meta_key     Custom field meta key.
 * @param  int     $field_id     Field ID.
 * @param  array   $fields       Sanitized entry field values/properties.
 * @param  array   $form_data    Processed form settings/data, prepared to be used later.
 * @return string

function wpf_post_submission_process_meta( $field_value, $meta_key, $field_id, $fields, $form_data ) {
	// If the field has a specific meta key and contains a unix time stamp,
	// use that for the post_meta value.
	if ( $meta_key === 'some_post_meta_key' && ! empty( $fields[ $field_id ][ 'unix' ] ) ) {
		$field_value = $fields[ $field_id ][ 'unix' ];

	return $field_value;
add_filter( 'wpforms_post_submissions_process_meta', 'wpf_post_submission_process_meta', 10, 5 );

Remember to replace the meta key in the code above to match whatever meta key you are using.

Snippet Reference: How to Store Checkbox Values as Arrays With Post Submissions