Building your first plugin by John Hawkins at WordCamp MSP

32
www.WordCampMSP.org T w e e t a b o u t t h i s s e s s i o n # W o r d C a m p M S P ! ! ! BUILDING YOUR FIRST PLUGIN WordPress 301 Follow John Hawkins @VegasGeek

description

This is the slide deck from my presentation at WordCamp MSP about Building your first WordPress plugin.

Transcript of Building your first plugin by John Hawkins at WordCamp MSP

Page 1: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

BUILDING YOUR FIRST PLUGINWordPress 301

Follow John Hawkins @VegasGeek

Page 2: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 3: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 4: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

HOW I GOT STARTED

Follow John Hawkins @VegasGeek

Page 5: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

- Tools- Hooks- Code- Resources

Follow John Hawkins @VegasGeek

About this presentation

Page 6: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

TOOLS

Follow John Hawkins @VegasGeek

Page 7: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 8: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 9: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

HOOKS

Follow John Hawkins @VegasGeek

Page 10: Building your first plugin by John Hawkins at WordCamp MSP

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?

Page 11: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 12: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 13: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

CODE

Follow John Hawkins @VegasGeek

Page 14: Building your first plugin by John Hawkins at WordCamp MSP

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?

Page 15: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 16: Building your first plugin by John Hawkins at WordCamp MSP

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

Page 17: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Plugin Header

Page 18: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Plugin Header

Page 19: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The Function

Page 20: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Page 21: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Page 22: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Add a settings page

Page 23: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The settings form

Page 24: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The settings form

Page 25: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The settings form

Page 26: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The settings form

Page 27: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

The settings form

Page 28: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Settings Page

Page 29: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

Follow John Hawkins @VegasGeek

Use the option values

Page 30: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

RESOURCES

Follow John Hawkins @VegasGeek

Page 31: Building your first plugin by John Hawkins at WordCamp MSP

www.

Wor

dCam

pMSP

.org

Tweet about this session #WordCam

pMSP

!!!

- http://codex.wordpress.org- http://vegasgeek.com/wc-msp

Follow John Hawkins @VegasGeek

Page 32: Building your first plugin by John Hawkins at WordCamp MSP

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!