WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So my script is simple right now just to test out the $entry field id's.

add_action("gform_after_submission_3", "set_post_content", 10, 2);
function set_post_content($entry, $form){
$subject = $entry["28"] . 'Applied as: ' . $entry["2"];
 mail( $emailremoved, $subject, $message);

Right now entry 28 is a dropdown, this one returns the selected value.

Entry 2 is the name field with split first and last. This returns nothing. Ive also tried $entry["2.1"] and get nothing.

Entry 34 (not added) is a multi checkbox. This value is not echoed out either.

This is a multipage form, but that shouldnt matter.

Any ideas why the values are not returning? They are saving to the form entry.

share|improve this question
up vote 0 down vote accepted

To debug you should print what's in $entry.

echo '<pre>' . print_r($entry,true) . '</pre>';
die();//You may need to kill the script to view..

Or email to yourself in your current mail function.

$message = '<pre>' . print_r($entry,true) . '</pre>';
share|improve this answer
Thanks a lot. I was so fixated on the single inputs that I didn't think to print them all. Thanks again for the help – David Hechler May 30 '12 at 15:03

As you are aware the normal and extended format name fields are constructed using multiple inputs, for this reason you also need to include the last digit from the input id in the key.

$entry['2.2'] // prefix
$entry['2.3'] // first
$entry['2.6'] // last
$entry['2.8'] // suffix
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.