I'm using the NinjaForms plugin which defines a Ninja_Forms()
global function.
Although I can call it without problem, I still get a warning/error
Undefined function 'Ninja_Forms'.
If this were a variable I'd use global foo
to suppress that.
How do I do that for a global function - i.e. is there a global
equivalent for functions?
I'm using the NinjaForms plugin which defines a Ninja_Forms()
global function.
Although I can call it without problem, I still get a warning/error
Undefined function 'Ninja_Forms'.
If this were a variable I'd use global foo
to suppress that.
How do I do that for a global function - i.e. is there a global
equivalent for functions?
- Global isn’t a magic way to suppress errors. You have a problem with your code that actually needs to be fixed. Where and how are you using the function? – Jacob Peattie Commented Jan 26, 2020 at 10:12
- I'm using the function as advertised by its author. I want to know what is the "global" equivalent for functions, if at all. The downvote was unnecessary. – lonix Commented Jan 26, 2020 at 10:54
- There isn’t one. The premise of your question is incorrect, which is why I’m saying that something else is wrong. And you didn’t answer my question: Where and how are you using the function? – Jacob Peattie Commented Jan 26, 2020 at 13:54
- That is irrelevant to my question - which was whether there is a global equivalent for functions? If not, then that's the answer. I don't like globals, but sometimes it's necessary/convenient. NinjaForms is a very popular plugin, so I'm not doing anything wrong. Thanks for your help. – lonix Commented Jan 27, 2020 at 6:52
- You are doing something wrong. If you weren’t there’d be no error. But you’re clearly not actually interested in figuring out what it is, having invented your own solution and refused to provide any information that could be used to help. For your own sake I hope that you’re less needlessly stubborn the next time you ask for help. – Jacob Peattie Commented Jan 27, 2020 at 6:58
1 Answer
Reset to default -1According to comments above, there is no "global" equivalent for functions. So I'm just gonna live with the warning, since everything works.