Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_pre_create_entry

This hook can be used to manipulate the values in an entry prior to its creation.

Usage

add_filter('frm_pre_create_entry', 'adjust_my_field');
function adjust_my_field($values)

Parameters

  • $values (array)

Examples

Prepend a value

This example allows you to prepend a static message before the user's field entry. For example, if the user entered '1234' and you wanted the value to be saved as 'ss-001234', you could use the code below to accomplish this.

add_filter('frm_pre_create_entry', 'adjust_my_field');
function adjust_my_field($values){
  if ( $values['form_id'] == 5 ) { //change 5 to your form id
    $current_value = $values['item_meta'][25]; // change 25 to to id of your field
    if ( strpos( $current_value, 'ss-00' ) === false ) { // check if the value is already included
      $values['item_meta'][25] = 'ss-00' . $values['item_meta'][25];
    }
  }
  return $values;
}
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms