Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Last active January 17, 2024 18:59
Show Gist options
  • Save johnmccole/62423f68d14f45721c173f1d1ceb5216 to your computer and use it in GitHub Desktop.
Save johnmccole/62423f68d14f45721c173f1d1ceb5216 to your computer and use it in GitHub Desktop.
// Populate Form Fields
// ID
add_filter( 'gform_field_value_ID', 'populate_ID' );
function populate_ID( $value ) {
$id = get_the_ID();
return $id;
}
// Job Title
add_filter( 'gform_field_value_jobTitle', 'populate_jobTitle' );
function populate_jobTitle( $value ) {
$job_title = get_the_title(get_the_ID());
return $job_title;
}
// Owner
add_filter( 'gform_field_value_owner', 'populate_owner' );
function populate_owner( $value ) {
$owner = get_field('owner_email', get_the_ID());
return $owner;
}
// City
add_filter( 'gform_field_value_jobCity', 'populate_city' );
function populate_city( $value ) {
$city = get_field('job_city', get_the_ID());
return $city;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment