Hi, if you just need the referrer to identify the enquiry comes from, you can take a small part of code from the link you provided. Put it to a plugin. This is the cleanest way an you can turn it on and off ;). I justed tested it and it works with caldera 1.7.6. (should also with the newer ones) …and actual WP Ver.
Small manual:
1. put a hidden field to your (copied) form an remember the field_id.
2. make a Dir in your pluginfolder called ie ‘caldera-forms-send-referrer’
3. make a php file called ‘cf-send-referrer.php’
4. put some code to this file ie like this and change the field_id to yours:
<?php
/**
* Plugin Name: Caldera Forms — Send referrer by hidden field
* Plugin URI: https://calderaforms.com/doc/caldera_forms_submit_post_process/
* Description: Just puts the referrer to an hidden field
* Version: 0.0.1
* Author: Shelob9, edited by st3phan
* Author URI: https://calderalabs.org
* License: GPL-2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
*/
// add action
add_action( 'caldera_forms_submit_post_process', function( $form, $referrer, $process_id, $entry_id ){
//make sure to set your field ID here, where to put the referrer.
$field_id = 'fld_1234567';
//get referrer
$ref_url = $_SERVER["HTTP_REFERER"];
//change value
Caldera_Forms::set_field_data( $field_id, $ref_url, $form, $entry_id );
}, 10, 4 );
5. activate the plugin
6. test it!
Good luck
-
This reply was modified 5 years, 8 months ago by st3phan5.