SlideShare a Scribd company logo
Writing Your Own Plugins
The basics and more
Pippin Williamson
pippinsplugins.com
@pippinsplugins
What makes up a plugin?
wp-content/plugins/my-plugin-name/
.php files
.js files
.css files
.mo/po files
image files
What defines a plugin?
The plugin header
wp-content/plugins/my-plugin/my-plugin.php
<?php
/**
* Plugin Name: My Plugin Name
* Description: A simple plugin
* Version: 1.0
* Author: Pippin Williamson
* Author URI: http://pippinsplugins.com
*/
The plugin header
plugins/simple-post-expiration/simple-post-expiration.php
<?php
/**
* Plugin Name: Simple Post Expiration
* Description: A simple post expiration plugin
* Version: 1.0
* Author: Pippin Williamson
* Author URI: http://pippinsplugins.com
*/
/wp-admin/plugins.php
Quick demo time
The plugin API
Action hooks:
do_action()
add_action()
remove_action()
remove_all_actions()
has_action()
did_action()
doing_action
Quick demo time
wp_footer action
https://github.com/WordPress/WordPress/blob/master/w
p-includes/general-template.php#L2051
The plugin API
Filter hooks:
apply_filters()
add_filter()
remove_filter()
remove_all_filters()
has_filter()
current_filter()
doing_filter()
Quick demo time
the_title filter
https://github.com/WordPress/WordPress/blob/master/w
p-includes/post-template.php#L99
Plugins for Inspiration
There are so many possibilities
Inspiring Dashboard
Not sure what to write about for your next blog post?
Maybe this Dashboard Widget can inspire you.
Adds a dashboard widget
Provides quick inspiration on something to write
http://wordpress.org/plugins/inspiring-dashboards/
Multi Site Plugins Add New
Enables the “Add New” menu under Plugins for multisite
The Add New Plugin screen is hard to get to
This plugin adds a shortcut
http://wordpress.org/plugins/multi-site-plugins-add-new/
CodePen oEmbed
Adds oEmbed support for CodePen.io
The Add New Plugin screen is hard to get to
This plugin adds a shortcut
http://wordpress.org/plugins/codepen-oembed/
Remove Comment Notes
Removes the notes section below the comment form
The notes section can create clutter
It isn’t needed in the majority of cases
http://wordpress.org/plugins/remove-comment-notes/
Write First
Blogging is about writing
Sends users directly to the edit screen upon login
http://wordpress.org/plugins/write-first/
Simple Post Expiration
A simple plugin to add an expiration date to posts
adds an “Expires on” field to post editor
prepends “Expired” to post titles once expired
is really simple
https://github.com/pippinsplugins/simple-post-expiration
Items to keep in mind
Overall structure of the plugin
How the data is stored
Features for launch
Features for tomorrow
Updates
Backwards compatibility
How the plugin will be distributed
When will you get started?

More Related Content

ODP
Beginning WordPress Plugin Development
KEY
Flex Piloting
PPTX
ADF in action 1.2
PPTX
Creating SmartPhone Apps Using WordPress
PDF
Ako na vlastne WP temy
PPT
PPT
Word press Plugins by WordPress Experts
PDF
Plugin development demystified 2017
Beginning WordPress Plugin Development
Flex Piloting
ADF in action 1.2
Creating SmartPhone Apps Using WordPress
Ako na vlastne WP temy
Word press Plugins by WordPress Experts
Plugin development demystified 2017

What's hot (20)

ODP
WordPress Plugin Development For Beginners
PDF
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
PDF
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
PDF
Developers, Be a Bada$$ with WP-CLI
PPT
Maven, Eclipse And OSGi Working Together
PDF
Why it's dangerous to turn off automatic updates and here's how to do it
PPTX
Update Smart: Use a Staging Site!
PDF
WordPress plugin development
PDF
Ionic CLI Adventures
PDF
Plugins at WordCamp Phoenix
PPTX
Jenkins workflows and Best Practices
PDF
Selenium 4 with Simon Stewart [Webinar]
PDF
8 Ways to Hack a WordPress website
PPTX
Anthony Somerset - Site Speed = Success!
PDF
Sergey Puzankov "How to see a bug the size of 1px"
PPT
Testing Any Site With Cucumber and Selenium
PPTX
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
PDF
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
PDF
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
PPTX
Varying wordpressdevelopmentenvironment wp-campus2016
WordPress Plugin Development For Beginners
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Developers, Be a Bada$$ with WP-CLI
Maven, Eclipse And OSGi Working Together
Why it's dangerous to turn off automatic updates and here's how to do it
Update Smart: Use a Staging Site!
WordPress plugin development
Ionic CLI Adventures
Plugins at WordCamp Phoenix
Jenkins workflows and Best Practices
Selenium 4 with Simon Stewart [Webinar]
8 Ways to Hack a WordPress website
Anthony Somerset - Site Speed = Success!
Sergey Puzankov "How to see a bug the size of 1px"
Testing Any Site With Cucumber and Selenium
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Introducing WordPress Multitenancy (Wordcamp Vegas/Orlando 2015/WPCampus)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Varying wordpressdevelopmentenvironment wp-campus2016
Ad

Similar to Writing Your Own WordPress Plugins - WordCamp Kansas City, 2014 (20)

PDF
Creating Your First WordPress Plugin
PDF
Intro to WordPress Plugin Development
PPT
WordPress for Libraries PreConference Workshop
PPTX
Getting started with WordPress development
PPT
Plugins And Making Your Own
PDF
Extending WordPress - a guide to building your first plugin
PPSX
Extending WordPress
PPT
Developing WordPress Plugins
PDF
Distributing UI Libraries: in a post Web-Component world
PPTX
Submitting, maintaining and growing a plugin on wp.org
PPTX
Intro to Plugin Development, Miami WordCamp, 2015
PDF
15 Essential WordPress Plugins
PPTX
ADF 2.4.0 And Beyond
PPTX
How to create your own WordPress plugin
PDF
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
PPTX
Introduction To Simple WordPress Plugin Development
PPTX
Automation Zaman Now
PDF
Write Your First WordPress Plugin
PDF
Don't worry be API with Slim framework and Joomla
PDF
Deploy a PHP App on Google App Engine
Creating Your First WordPress Plugin
Intro to WordPress Plugin Development
WordPress for Libraries PreConference Workshop
Getting started with WordPress development
Plugins And Making Your Own
Extending WordPress - a guide to building your first plugin
Extending WordPress
Developing WordPress Plugins
Distributing UI Libraries: in a post Web-Component world
Submitting, maintaining and growing a plugin on wp.org
Intro to Plugin Development, Miami WordCamp, 2015
15 Essential WordPress Plugins
ADF 2.4.0 And Beyond
How to create your own WordPress plugin
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Introduction To Simple WordPress Plugin Development
Automation Zaman Now
Write Your First WordPress Plugin
Don't worry be API with Slim framework and Joomla
Deploy a PHP App on Google App Engine
Ad

Recently uploaded (20)

PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
August Patch Tuesday
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Mushroom cultivation and it's methods.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
A Presentation on Touch Screen Technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
August Patch Tuesday
Group 1 Presentation -Planning and Decision Making .pptx
Chapter 5: Probability Theory and Statistics
Mushroom cultivation and it's methods.pdf
Programs and apps: productivity, graphics, security and other tools
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Enhancing emotion recognition model for a student engagement use case through...
Tartificialntelligence_presentation.pptx
Getting Started with Data Integration: FME Form 101
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
1 - Historical Antecedents, Social Consideration.pdf
A Presentation on Touch Screen Technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative study of natural language inference in Swahili using monolingua...
cloud_computing_Infrastucture_as_cloud_p
A novel scalable deep ensemble learning framework for big data classification...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Digital-Transformation-Roadmap-for-Companies.pptx

Writing Your Own WordPress Plugins - WordCamp Kansas City, 2014