WordPress.org

Ready to get started?Download WordPress

Forums

Using WordPress functions inside class definitions (1 post)

  1. techxplorer
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic