I’m currently in the process of writing my first WordPress plugin. All of my code is wrapped up inside a class.
I just realised that I’ve been blithely using WordPress functions, such as update_option / get_option inside my class definition. And they work!
My question is, why do they work? Why is it that my class can access these types of functions?
Based on my understanding of variable / function scope I would have thought WordPress functions wouldn’t be available. I’m glad they are, I just don’t understand why they are.
- The topic ‘Using WordPress functions inside class definitions’ is closed to new replies.