Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created May 5, 2015 19:45
Show Gist options
  • Save digisavvy/a4afef6a8a4447c31bbc to your computer and use it in GitHub Desktop.
Save digisavvy/a4afef6a8a4447c31bbc to your computer and use it in GitHub Desktop.
Ninja Forms Filter
// Pre-Populate Talent Inquiry Form
function digisavvy_pre_pop_talent_title( $data, $field_id ){
global $ninja_forms_processing;
// Get the current form_id
$form_id = $ninja_forms_processing->get_form_ID(); // Gets the ID of the form we are currently processing.
// If the form_id is the form we want
if( $form_id == 5 ){
if( $field_id == 3 ){
$data['default_value'] = get_the_title();
}
return $data;
}
}
add_filter( 'ninja_forms_field', 'digisavvy_pre_pop_talent_title', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment