Hooking does not seem to work?
-
Probably my own fault somehow, but if somebody could take 2 minutes and help me with this it would be awesome:
I more or less copied an example for a hook into the functions.php of my theme.
add_action( 'init', 'ninja_forms_register_example' ); function ninja_forms_register_example(){ add_action('ninja_forms_post_process', 'ninja_forms_example'); } function ninja_forms_example(){ global $ninja_forms_processing; //Add the text Hello World to the user value. $user_value = "Hello World."; //Update the user submitted value for the field with an ID of 11: $ninja_forms_processing->update_field_value( 11, $user_value ); $ninja_forms_processing->update_field_value( 2, 1 ); }The add_action seems to work, i put an echo command into the ninja_forms_register_example and it shows up on the page. However the second part does not work. Field 11 is a text field, so it should work. Field 2 is a radio button with 5 choices, so value 1 should be valid as well?! I can also change ninja_forms_post_process for other hooks but it doesn’t change the outcome, sometimes the “Processing..” will just show up and nothing will happen further.
What am i doing wrong?
The topic ‘Hooking does not seem to work?’ is closed to new replies.