Posted: April 7, 2016 at 7:57 am
|
Hi, I recently bought EE4 plugin with EE4 Everything License for a client development. I tried to add one custom question type without success. I’ve followed this gist snippet: https://gist.github.com/joshfeck/4b2e36b8201173750f78 The filter looks ok but does nothing. Hardcoding the core works but I wanna avoid that at all costs, of course. Can someone point me in the right direction to accomplish this? Thanks in advance |
|
Hi again, I just wanna point that the snippet was in a file named functions_ee.php included in functions.php with require_once. Once I put the snippet in functions.php file, worked. |
Hi there, We generally recommend adding custom code snippets to a functions plugin or into your WordPress theme’s functions.php file. This helps ensure the code gets loaded at the right time (i.e. not too early and not too late). |
|
|
Hi again, I would like to ask something very related to the original question. I have added one custom question type (session_checkbox) which should act like a checkbox. To try to acomplish this I have added this piece of code to functions.php
I have dequeued the script espresso_registration_form_single and enqueued a custom version of it to add this Everything looks ok but once saved the registration form only the first checkbox checked is saved instead all checked values. If I go to the registrations admin zone and edit the answer for my custom question type, it’s saved correctly with the multiple checkboxes. There is something I am missing or should I do something differently? Thanks in advance. |
For that specific filter (‘FHEE__EEM_Question__construct__allowed_question_types ‘) to work you’ll need to load your callback and callback function from a plugin. If you try to load it from the theme’s functions.php file it will be too late for the filter to take effect. |
|
|
Thanks Josh, that worked like a charm. |
The support post ‘Registration form custom question type’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.