caldera_forms_create_form hook being fired twice
-
I’m trying to use the caldera_forms_create_form hook.
My intention is to create a page programmatically, containing the form.
My problems is that it seems to fire twice, both when creating an entirely new form and when cloning an existing form.
Right now, I’m just doing this in a file in a functionality-plugin:
function omk_caldera_create_page($newform) { $pagetitle = $newform['name']; error_log($pagetitle); $pageslug = 'caldera-' . $newform['ID'] . '-' . time(); error_log($pageslug); $pagecontent = '[caldera_form id="'. $newform['ID'] . '"]'; error_log($pagecontent); error_log( time() ); return $newform; } add_action( 'caldera_forms_create_form', 'omk_caldera_create_page', 10, 1 );
Just extracting some information from the form array and error_logging it.
If I create a new form or clone one, say with the new title being “Caldera form 3” I get this in my debug.log:
[14-Sep-2017 19:11:00 UTC] Caldera form 3 [14-Sep-2017 19:11:00 UTC] survey-CF59bad444b49af-1505416260 [14-Sep-2017 19:11:00 UTC] [caldera_form id="CF59bad444b49af"] [14-Sep-2017 19:11:00 UTC] 1505416260 [14-Sep-2017 19:11:00 UTC] Caldera form 3 [14-Sep-2017 19:11:00 UTC] survey-CF59bad444b49af-1505416260 [14-Sep-2017 19:11:00 UTC] [caldera_form id="CF59bad444b49af"] [14-Sep-2017 19:11:00 UTC] 1505416260
Why is that?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘caldera_forms_create_form hook being fired twice’ is closed to new replies.