Misc

Developing Class-Based Plugins

Now that we've defined object-oriented programming and explored just enough to lay a foundation, it's time to actually begin talking about the components of OOP-based development in the context of WordPress plugins.

Throughout the rest of this article, we're going to cover the basics of what's required for writing OOP-based plugins, and the advantages that it brings.
Defining the Class

Before you do anything in object-oriented development, you have to define your class. Assuming that you already have an idea as to what your class is going to do, this generally a matter of coming up with what you want to name your class.

For the most part, I think that viewing example code is always advantageous when actually teaching code, so we'll be taking a look at the WordPress Plugin Boilerplate.

Note that the Plugin Boilerplate is a project that I originally created to help jumpstart OOP-based plugins. It's since been contributed to by a number of different people. I'm using it in this article because it demonstrates the topic at hand.

2 Kommentaar

Afrikaans.com wil aan jou, die leser, die geleentheid gee om in gesprek te tree en deel te neem. Ons sal egter geen vorm van haatspraak, kru, kras of vuil taal duld nie. Geen rassisme, seksisme, homofobie, persoonlike aanvalle of ander vorms van haatspraak word hier toegelaat nie. Afrikaans.com behou die reg voor om enige kommentaar te verwyder wat nie aan ons bepalings en voorwaardes vir deelname voldoen nie. Redes vir die verwydering hoef nie deur Afrikaans.com verskaf te word nie. Hou in gedagte dat Afrikaans.com en jy as deelnemer aanspreeklik gehou word as jy iemand se regte skend.

Tik die syfers hier (Vervang syfers)
se bepalings en voorwaardes

Mbusi Lukhele
  10 Maart 2016

Testing comments


Mbusi Lukhele
  10 Maart 2016

Testing comments