I’m trying to create a custom plugin using PHP that pulls a list from a table and uses it to populate a pulldown list in Caldera Forms. The plugin works fine up to the point where I get the error: “Error: Call to undefined function add_filter()”. What am I missing? Here’s my code that’s failing:

‘Names of Ethnicities’,
‘data’ => $ethnicityName,
);

return $presets;

});

?>

Read more here: Why do I get a PHP error on the add_filter function?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: