When you need to add some custom functionality to your WordPress site, the best place to put it is in a plugin.
A plugin allows you to add all sorts of things to your WordPress site, from small customizations all the way to up to API integrations, and more.
Join us to learn how plugins work in WordPress, how to create your first plugin and a few fun examples of what plugins can do.
Extending WordPress: common security vulnerabilities
Let's code! Creating your first WordPress Plugin
1. 1
👋 Welcome!
As you join, feel free to
answer these questions in
the chat:
1. What region are you joining us from?
2. What do you do with WordPress?
3. What are you hoping to learn today?
3. Announcements
○ Welcome, and thanks to Kathryn for co-hosting with me today!
○ We’ll be presenting in focus mode.
○ You are welcome to ask questions.
○ You are welcome to unmute to ask questions, or post them in the chat.
4. Announcements
○ Final code from this session:
• https://github.com/jonathanbossenger/wordpress-plugin
• https://github.com/jonathanbossenger/wordpress-
plugin/releases/download/1.0.0/wordpress-plugin.zip
○ If I am going to fast, please let me know!
○ We will be posting this session to https://wordpress.tv/ afterwards
○ More more WordPress focused content please visit https://learn.wordpress.org/
5. Learning Outcomes
○ What is a plugin
○ When to use a plugin vs creating a child theme
○ How to create a plugin for WordPress
• What is the bare minimum needed for a valid plugin
• Adding some plugin details to your plugin header
○ Experiment #1: Interacting with the WordPress Dashboard
○ Experiment #2: Interacting with your WordPress theme
○ Experiment #3: Interacting with something outside of WordPress
6. What is a plugin?
○ https://developer.wordpress.org/plugins/intro/what-is-a-plugin/
○ Plugins are packages of code that extend the core functionality of WordPress.
○ Plugins are made up of PHP code and can include other assets such as images,
CSS, and JavaScript.
○ All you need to create a plugin is to turn a great idea into code.
○ Plugin Developer Handbook
• https://developer.wordpress.org/plugins/
7. When should I use a plugin vs a child theme?
○ Creating your first child theme
• https://wordpress.tv/2022/07/11/lets-code-creating-your-first-wordpress-
child-theme/
○ Two things to note
• Plugins are loaded before themes/child themes
• Plugins can be independent of the theme, child themes are reliant on the
parent theme.
8. When should I use a plugin vs a child theme?
○ Use a child theme when your custom functionality is directly related to the
theme’s layout or design
• Custom CSS
• Custom templates
• Functionality related to custom CSS or a custom template.
9. When should I use a plugin vs a child theme?
○ Use a plugin when your custom functionality is not related to the theme’s
layout or design
• A form that you want to use in multiple places
• Adding a custom database table for specialist data
• Connecting to external APIs to display data on a site