• Resolved Jakob Smith

    (@diakrisis)


    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)
  • Plugin Contributor christiechirinos

    (@christiechirinos)

    Hi Jacob,

    Thank you for using Caldera Forms, we hope you’ve found it useful and powerful thus far.

    The Caldera Forms plugin is 100% free and open-source and always will be for users like you on the WordPress platform. However, for help from our team at Caldera Labs, the company behind Caldera Forms, we ask that you purchase Caldera Forms Pro. The Caldera Forms Pro platform includes access to priority support, among other benefits like enhanced notification delivery, advanced layout building, form analytics and access to over 25 premium Caldera Forms add-ons.

    You can browse plans at https://calderaforms.com/pro/. Once you have Caldera Forms Pro, you can request support at https://calderaforms.com/support/.

Viewing 1 replies (of 1 total)
  • The topic ‘caldera_forms_create_form hook being fired twice’ is closed to new replies.