building your first plugin by john hawkins at wordcamp msp
DESCRIPTION
This is the slide deck from my presentation at WordCamp MSP about Building your first WordPress plugin.TRANSCRIPT
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
BUILDING YOUR FIRST PLUGINWordPress 301
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Husband- Dad- Self-Employed- Web Developer- Geek
Follow John Hawkins @VegasGeek
Hi, I’m John
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- 9seeds.com- VegasGeek.com- @vegasgeek- Spend too much time in
front of the computer
Follow John Hawkins @VegasGeek
What I do
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
HOW I GOT STARTED
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Tools- Hooks- Code- Resources
Follow John Hawkins @VegasGeek
About this presentation
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
TOOLS
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Windows: XAMPPhttp://vegasgeek.com/xampp
- Older Mac (like me): MAMPhttp://vegasgeek.com/mamp
Follow John Hawkins @VegasGeek
Develop Locally
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Syntax Highlighting- Error Checking- Auto-Complete functions- NetBeans / PHP Storm
Follow John Hawkins @VegasGeek
Use an IDE
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
HOOKS
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Specific points in the WordPress codeused to interact with WordPress
- Two types of hooks; Actions and Filters- 1,300+ hooks in WordPress 3.0
Follow John Hawkins @VegasGeek
What’s a Hook?
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Tell WordPress to perform a functionat a specific time
Follow John Hawkins @VegasGeek
Action Hooks
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Passes data to your function- Your function can modify the data and
send it back to WordPress
Follow John Hawkins @VegasGeek
Filter Hooks
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
CODE
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Create a shortcode- Display info for an upcoming event
in a page or post- Create an admin panel to update
event info
Follow John Hawkins @VegasGeek
What will it do?
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Single files go directly in the plugin folder
- Multiple files go in their own folder
- WordPress only looks one folder deep
Follow John Hawkins @VegasGeek
The Plugin Folder
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- Single files go directly in the plugin folder
- Multiple files go in their own folder
- WordPress only looks one folder deep
Follow John Hawkins @VegasGeek
The Plugin Folder
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
Plugin Header
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
Plugin Header
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The Function
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
Add a settings page
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The settings form
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The settings form
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The settings form
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The settings form
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
The settings form
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
Settings Page
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
Follow John Hawkins @VegasGeek
Use the option values
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
RESOURCES
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
- http://codex.wordpress.org- http://vegasgeek.com/wc-msp
Follow John Hawkins @VegasGeek
www.
Wor
dCam
pMSP
.org
Tweet about this session #WordCam
pMSP
!!!
John [email protected]
Work: http://9seeds.comBlog: http://vegasgeek.comTweet: @vegasgeek
Follow John Hawkins @VegasGeek
Thank You!