Created
May 5, 2015 19:45
-
-
Save digisavvy/a4afef6a8a4447c31bbc to your computer and use it in GitHub Desktop.
Ninja Forms Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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