PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Where exactly to add the code in form_detail.php?

  1. Hi there

    I would like to add my own list to the Predefined Choices field; unfortunately this is not something built in to Gforms but I hope you will make that an option soon. In the meantime, I am a novice at PHP.

    I did find the solution in this post: http://www.gravityhelp.com/forums/topic/using-the-gform-predefined-choices-filter

    but I don't know where EXACTLY in the form_detail.php I need to paste this code:

    <?php
    
    add_filter("gform_predefined_choices", "add_predefined_choice");
    function add_predefined_choice($choices){
       $choices["My New Choice"] = array("Choice 1", "Choice 2", "Choice 3");
       return $choices;
    }
    ?>

    I do understand I need to add my own title and array/choices into the code before inserting it; but just where to PASTE the code into the form_detail.php so I don't break the plugin??

    thanks!!

    Posted 13 years ago on Tuesday July 12, 2011 | Permalink
  2. You don't need to modify any of the core plugin files. You add that code to your theme's functions.php file.

    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Posted 13 years ago on Wednesday July 13, 2011 | Permalink
  3. THANK YOU, Kevin!!

    Posted 13 years ago on Wednesday July 13, 2011 | Permalink

This topic has been resolved and has been closed to new replies.