Prepend a value

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 ) { //…Continue reading

Only allow one edit

add_filter(‘frm_user_can_edit’, ‘check_user_edit_entry’, 10, 2); function check_user_edit_entry($edit, $args){ $form_id = is_numeric($args[‘form’]) ? $args[‘form’] : $args[‘form’]->id; if ( $form_id == 45 ){ //change 45 to the ID of your form if ( is_numeric( $args[‘entry’] ) ) { $entry = FrmEntry::getOne( $args[‘entry’] );…Continue reading

Prevent editing based on field value

add_filter(‘frm_user_can_edit’, ‘maybe_prevent_user_edit_entry’, 10, 2); function maybe_prevent_user_edit_entry( $edit, $args ){ if ( ! $edit ) { // user can’t edit anyway, so don’t check return $edit; } if ( $args[‘form’]->id != 45 ) { //change 45 to the ID of your…Continue reading

Organize by user login

add_filter( ‘frm_upload_folder’, ‘frm_custom_upload’, 10, 2 ); function frm_custom_upload( $folder, $atts ) { if ( $atts[‘form_id’] == 25 ) { // change to your form id global $current_user; $folder = $folder . ‘/’ . $current_user->user_login; } return $folder; }Continue reading

Customize Deletion Message

add_filter(‘frm_delete_message’, ‘customize_delete_message’, 10, 2); function customize_delete_message($message, $entry) { if ( $entry->form_id == 216 ) {//Change 216 to the ID of your form $message = ‘Item successfully removed from favorites’; } return $message; }Continue reading

Basic example

add_filter(‘frm_redirect_url’, ‘return_page’, 9, 3); function return_page($url, $form, $params){ if($form->id == 5){ //change 5 to the ID of the form to redirect $field_id = 125; //change 125 the the ID of the radio or dropdown field if($_POST[‘item_meta’][$field_id] == ‘Option 1‘) {…Continue reading

More advanced example

add_filter(‘frm_redirect_url’, ‘return_page’, 9, 3); function return_page($url, $form, $params){ if($form->id == 5){ //change 5 to the ID of the form to redirect $field_id = 25; //change 25 the the ID of the radio or dropdown field if($_POST[‘item_meta’][$field_id] == ‘A’){ if($_POST[‘item_meta’][26] ==…Continue reading

Change URL when updating

add_filter(‘frm_redirect_url’, ‘return_page’, 9, 3); function return_page($url, $form, $params){ if(!isset($params[‘action’])){ $params[‘action’] = FrmAppHelper::get_param(‘frm_action’); } if($form->id == 5 and $params[‘action’] == ‘update’){ //change 5 to the id of your form $url = ‘http://example.com/redirect-page‘; } return $url; }Continue reading

Allow logged-out users to edit entries

add_filter(‘frm_user_can_edit’, ‘check_user_edit_form’, 10, 2); function check_user_edit_form($edit, $args){ $form_id = is_numeric($args[‘form’]) ? $args[‘form’] : $args[‘form’]->id; if($form_id == 5){ //change 5 to the ID of your form $edit = true; } return $edit; }Continue reading