This entry is part 14 of 14 in the Plugin Development 101 Series
- Introduction to WordPress Plugin Development 101
- Plugin Development 101 – What Makes a Plugin?
- Plugin Development 101 – General Best Practices
- Plugin Development 101 – An Intro to Filters
- Plugin Development 101 – Intro to Actions
- Plugin Development 101 – Registering a Custom Post Type
- Plugin Development 101 – Intro to Short Codes
- Plugin Development 101 – Intro to Loading Scripts and Styles
- Plugin Development 101 – Introduction to Adding Dashboard Menus
- Plugin Development 101 – Separating Your Plugin into Multiple Files
- Plugin Development 101 – Your First OOP Plugin
- Plugin Development 101 – Dissecting the Featured Comments Plugin
- Plugin Development 101 – Digging Into WordPress Core to Solve a Problem
- Plugin Development 101 – Introduction to extending classes
This episode of Plugin Development 101 introduces you to how to extend classes in PHP and Object Oriented Programming.
PHP extends allows you to create a new class that is based off of an existing class, meaning it inherits properties and methods from the base class.
The complete code written in the video can be seen below:
You can see the EDD_Export and EDD_Download_History_Export classes as well if you’d like to further study them.
“One of the best ways to learn how things work is to break them.”
Great advice if you want to learn to code… not so good if you are studying medicine, for example. 😉
Great stuff – so well explained!
Hi Pippins,
Just a general question, I completed your 3 series (Plugin Dev 101, Plugin Thoughts, Writing your first plugin, Beg to Advance).
Do you think it is enough knowledge for me to start writing a medium complex plugin? Or there are some additional material (other Pippins series, book, online resources) that you recommend me to explore before start writing the plugin?
It’s definitely enough.
Will you now know how to do everything? No, but one of the best ways to learn more is by doing. Start building your plugins and you will be surprised at how much you know and how much you can quickly pick up on.
Hi Pippin,
I see the code like below in your video, and woocommerce also.
if ( ! defined( ‘ABSPATH’ ) ) {
exit; // Exit if accessed directly.
}
What is the purpose of that code?
Thanks!
It ensures the file cannot be accessed or executed by loading it directly.
Hello Pippin,
I just finished this series and thank you for this friendly and effective tutorial for beginners, your effort is much appreciated.
In your opinion, which tutorial series should I go from here to further develop my present knowledge of wordpress development. I have done courses on PHP and MySQL (including OOP) and am comfortable with it, and at present learning Javacript through an online course.
Your suggestions, as always, are highly valued. Thank you.
From this site, the database API series would be a good next step: https://pippinsplugins.com/series/building-a-database-abstraction-layer/
It is really simple when you explain it, thanks!