Your code is checking for Yes or No, but the answers to the question are 1 or 0. These must match for the conditional tag to be applied. I heard in the video where you mentioned you tried 1 and 0, so did you trycase '1' :
or was itcase 1 :

There is a difference between the above two examples.

Also, you can verify that:

the Infusionsoft add-on is activated on your site

Your custom plugin is activated on your site

Lastly, filter hooks should be hooked to with add_filter() instead of add_action(). I think add_action() may work in this case, but it’s technically the wrong function to use when working with WordPress filter hooks.

And the reason for that is you’ve changed the code to use a - in the variable name. This:

$answer_to_course-materials

If I rewrite that just a little so its clear how PHP will parse that:

$answer_to_course - materials

{variable} {minus} {contstant}

Dashes should not be used in variable names as they are used as the subtraction operator, in some case they may appear to be working, say when working with strings, but if you check the error log you’ll see all kind of undefined constant notices.

Change any instances of $answer_to_course-materials to $answer_to_course_materials and retest.

You can only have one function with that name, otherwise, PHP doesn’t know which function it should use when you call it.

So you can either, add your additional code to the ee_infusionsoft_save_my_custom_questions function in aw-teo.php or, you can rename the function you are using in gbf-admin-custon.php (if you do that you’ll need to update the filter call back to use the new function name).

Because you still have the original function with the same name, as mentioned above, you can’t have 2 functions with the same name as PHP doesn’t know which to run. So you either combine the 2 functions together or rename one of them.

Right now you’ve moved the new function into the same plugin as the old one, they both still have the same name so still cause the same problem.

The support post ‘Infusionsoft Tagging Based on Custom Question Answer’ 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.