SlideShare una empresa de Scribd logo
1 de 37
How to create a
WordPress plugin.
WordCamp Toronto Dev 2012
@thisismyurl
What is a Plugin?
A WordPress plugin is a PHP based addition to the
WordPress blogging platform.

• Plugins are functions which interact with WordPress Core code;

• A Plugin changes what WordPress does;

• Plugins are stored external of the theme;
What can they do?
Since Plugins are executed as part of the WordPress platform,
they’re almost limitless.

• Plugins can interact with WordPress via Hooks and Actions;

• They can create, or interact with API’s in the WordPress system;

• Plugins can affect Posts, Pages, Users, or any part of the WordPress tool;
When should you use a
Plugin?
Plugin functions can be stored as a plugin, or in a theme
function.php file, why choose?

• Functions are specifically part of the theme;

• Plugins allow you to share code outside a theme, across multiple designs;

• Plugins can be activated in multisite environments;
Theme functions are
restricted to a single
theme.




 Plugins deliver the same code to multiple blogs, on the same server
 or across multiple hosting accounts.
How WordPress finds a
Plugin
WordPress will automatically locate plugins on a standard
install, adding them to the admin

• /wp-content/plugins/filename.php

• /wp-content/plugins/folder-name/filename.php

• WordPress will search one level deep in the plugins folder;

• Searches for .php files with a valid plugin header;
Plugin header
Plugin header
Complete Plugin
Play nice with other
functions
Remember WordPress shares your plugin functions across the
entire site, be unique

• Your plugins should use a unique name for all functions;

• function demo_plugin_function_name() for example;

• Plugin file load order is determined by WordPress;
What are Actions?
Actions are triggered by WordPress, causing your plugin to
spring to life.

• There’s an action for almost everything WordPress does

• http://codex.wordpress.org/Plugin_API/Action_Reference
What are Filters?
Filters allow you to change content WordPress
has created.

• There’s an filter for almost everything WordPress does

• http://codex.wordpress.org/Plugin_API
Building a Plugin
Let’s get started with something basic.
A standard WordPress function
A standard WordPress plugin
Adding a link items to the Plugins page list
Adding an item to the Settings menu
Creating a settings page
Adding items to the settings page
Defining the settings page
Defining the default values
Showing the values
A standard WordPress function
A standard WordPress function, calling settings
Adding a Shortcode
The entire plugin




http://wordpress.org/extend/plugins/fetch-twitter-count-for-wordpress/
How to uninstall the data from your plugin




• Stored separately in an uninstall.php file.
Plugin Best Practises
Some ideas on how to do it right.
Be unique.
Remember Plugins interact will all the code on your
WordPress website, make sure you’re unique.


• Classes and Functions should use unique names;

• thisismyurl_plugin_name_function_name() for example;
Be descriptive.
Your Plugin is part of something else, make sure people can
easily understand your code.


• Elements should use verbose naming conventions, easy to understand;

• $i is bad;

• $loop_resume_posts is good;
Be consistent.
There are standards in the WordPress community, following
them makes it easy.


• The WordPress coding standards make coding easier in the long run;

• If you’re following your own coding standards, stick to them;

• http://codex.wordpress.org/WordPress_Coding_Standards
Be lazy, but smart.
In my experience, somebody else has already done a lot of the
heavy lifting so look before you code.
Contributing a Plugin.
How to help.
Be respectful.
Some authors like to work on their plugins alone. If you’d
like to help, ask.
Fork it.
All plugins on WordPress.org are released under the GNU
licensing terms, if you can’t collaborate, innovate.
Give Back.
If you’ve written a WordPress Plugin that you think the
community will benefit from, submit it to WordPress.org for
review and consideration.
@thisismyurl
Christopher Ross (info@thisismyurl.com)

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Top web development tools
Top web development toolsTop web development tools
Top web development tools
 
Page layout with css
Page layout with cssPage layout with css
Page layout with css
 
Javascript
JavascriptJavascript
Javascript
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Working With WordPress Widgets
Working With WordPress WidgetsWorking With WordPress Widgets
Working With WordPress Widgets
 
.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnet.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnet
 
Html forms
Html formsHtml forms
Html forms
 
Javascript
JavascriptJavascript
Javascript
 
Django
DjangoDjango
Django
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web development
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Angular Lifecycle Hooks
Angular Lifecycle HooksAngular Lifecycle Hooks
Angular Lifecycle Hooks
 
Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configuration
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme development
 
WordPress Webinar Training Presentation
WordPress Webinar Training PresentationWordPress Webinar Training Presentation
WordPress Webinar Training Presentation
 

Destacado

Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebie
Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebieCyfrowy świat nas otacza, więc weźmy z niego coś dla siebie
Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebieArkadiusz Stęplowski
 
Motywy dla WordPressa - historia prawdziwa - WordUp Katowice
Motywy dla WordPressa - historia prawdziwa - WordUp KatowiceMotywy dla WordPressa - historia prawdziwa - WordUp Katowice
Motywy dla WordPressa - historia prawdziwa - WordUp KatowiceTomasz Dziuda
 
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowejWordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowejMaciek Kuchnik
 
AMP + WP = błyskawiczny związek?
AMP + WP = błyskawiczny związek?AMP + WP = błyskawiczny związek?
AMP + WP = błyskawiczny związek?Tomasz Pawlisiak
 
WooCommerce - Jak zacząć?
WooCommerce - Jak zacząć?WooCommerce - Jak zacząć?
WooCommerce - Jak zacząć?Jakub Jaworowicz
 
Od zera do motywów kodera
Od zera  do motywów koderaOd zera  do motywów kodera
Od zera do motywów koderaDawid Szwed
 
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...Szymon Słowik
 
Social Desk - prezentacja produktów
Social Desk - prezentacja produktówSocial Desk - prezentacja produktów
Social Desk - prezentacja produktówDawid Pacha
 
Jak modyfikować motywy WooCommerce
Jak modyfikować motywy WooCommerceJak modyfikować motywy WooCommerce
Jak modyfikować motywy WooCommerceMaciej Swoboda
 
WordCamp 2016 Najdłuższe wdrożenie świata
WordCamp 2016 Najdłuższe wdrożenie świataWordCamp 2016 Najdłuższe wdrożenie świata
WordCamp 2016 Najdłuższe wdrożenie świataArkadiusz Stęplowski
 
WordPress heartbeat API w praktyce
WordPress heartbeat API w praktyceWordPress heartbeat API w praktyce
WordPress heartbeat API w praktyceMaciek Kuchnik
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTomasz Dziuda
 
WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014Maciek Kuchnik
 
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013Tomasz Dziuda
 
Najpopularniejsze wtyczki WooCommerce
Najpopularniejsze wtyczki WooCommerceNajpopularniejsze wtyczki WooCommerce
Najpopularniejsze wtyczki WooCommerceMaciej Swoboda
 
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego bloga
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego blogaUnikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego bloga
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego blogaBartosz Romanowski
 
Komentowac, jak to łatwo powiedzieć...
Komentowac, jak to łatwo powiedzieć...Komentowac, jak to łatwo powiedzieć...
Komentowac, jak to łatwo powiedzieć...Jakub Milczarek
 
Word up warszawa 2015
Word up warszawa 2015Word up warszawa 2015
Word up warszawa 2015Tomasz Dziuda
 

Destacado (20)

Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebie
Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebieCyfrowy świat nas otacza, więc weźmy z niego coś dla siebie
Cyfrowy świat nas otacza, więc weźmy z niego coś dla siebie
 
Motywy dla WordPressa - historia prawdziwa - WordUp Katowice
Motywy dla WordPressa - historia prawdziwa - WordUp KatowiceMotywy dla WordPressa - historia prawdziwa - WordUp Katowice
Motywy dla WordPressa - historia prawdziwa - WordUp Katowice
 
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowejWordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
WordUp Kraków - Maciej Kuchnik - WordPress jako baza dla aplikacji internetowej
 
AMP + WP = błyskawiczny związek?
AMP + WP = błyskawiczny związek?AMP + WP = błyskawiczny związek?
AMP + WP = błyskawiczny związek?
 
WooCommerce - Jak zacząć?
WooCommerce - Jak zacząć?WooCommerce - Jak zacząć?
WooCommerce - Jak zacząć?
 
Od zera do motywów kodera
Od zera  do motywów koderaOd zera  do motywów kodera
Od zera do motywów kodera
 
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...
Estetyka w e-commerce. Jak nie przedobrzyć i nie zabić funkcjonalności oraz s...
 
Social Desk - prezentacja produktów
Social Desk - prezentacja produktówSocial Desk - prezentacja produktów
Social Desk - prezentacja produktów
 
Jak modyfikować motywy WooCommerce
Jak modyfikować motywy WooCommerceJak modyfikować motywy WooCommerce
Jak modyfikować motywy WooCommerce
 
WordCamp 2016 Najdłuższe wdrożenie świata
WordCamp 2016 Najdłuższe wdrożenie świataWordCamp 2016 Najdłuższe wdrożenie świata
WordCamp 2016 Najdłuższe wdrożenie świata
 
Daj się wyręczyć
Daj się wyręczyćDaj się wyręczyć
Daj się wyręczyć
 
WordPress heartbeat API w praktyce
WordPress heartbeat API w praktyceWordPress heartbeat API w praktyce
WordPress heartbeat API w praktyce
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
 
WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014WP-Cron - WordUp Kraków Zima 2014
WP-Cron - WordUp Kraków Zima 2014
 
Jak wkurzyć użytkownika
Jak wkurzyć użytkownikaJak wkurzyć użytkownika
Jak wkurzyć użytkownika
 
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013
Widżet GK News Show Pro na 10 sposobów - WordUp Kraków 2013
 
Najpopularniejsze wtyczki WooCommerce
Najpopularniejsze wtyczki WooCommerceNajpopularniejsze wtyczki WooCommerce
Najpopularniejsze wtyczki WooCommerce
 
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego bloga
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego blogaUnikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego bloga
Unikaj falstartów - o czym warto pamiętać przed uruchomieniem nowego bloga
 
Komentowac, jak to łatwo powiedzieć...
Komentowac, jak to łatwo powiedzieć...Komentowac, jak to łatwo powiedzieć...
Komentowac, jak to łatwo powiedzieć...
 
Word up warszawa 2015
Word up warszawa 2015Word up warszawa 2015
Word up warszawa 2015
 

Similar a WordPress plugins

Getting Started with WordPress Plugin Development
Getting Started with WordPress Plugin DevelopmentGetting Started with WordPress Plugin Development
Getting Started with WordPress Plugin DevelopmentAbhishek Deshpande
 
How to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginHow to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginAndolasoft Inc
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress PluginsKristen Symonds
 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopBrendan Sera-Shriar
 
Developing WordPress Plugins : For Begineers
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For BegineersM A Hossain Tonu
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017ylefebvre
 
5 Steps to Develop a WordPress Plugin From Scratch.pdf
5 Steps to Develop a WordPress Plugin From Scratch.pdf5 Steps to Develop a WordPress Plugin From Scratch.pdf
5 Steps to Develop a WordPress Plugin From Scratch.pdfBeePlugin
 
WordPress Plugin Development
WordPress Plugin DevelopmentWordPress Plugin Development
WordPress Plugin DevelopmentAdam Englander
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress pluginJohn Tighe
 
Introduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentIntroduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentBruce L Chamoff
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
Kick start your career with wordpress
Kick start your career with wordpressKick start your career with wordpress
Kick start your career with wordpressOpenDev
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia
 
Building your first plugin
Building your first pluginBuilding your first plugin
Building your first pluginScott DeLuzio
 
Extending WordPress - a guide to building your first plugin
Extending WordPress -  a guide to building your first pluginExtending WordPress -  a guide to building your first plugin
Extending WordPress - a guide to building your first pluginJonathan Bossenger
 

Similar a WordPress plugins (20)

Getting Started with WordPress Plugin Development
Getting Started with WordPress Plugin DevelopmentGetting Started with WordPress Plugin Development
Getting Started with WordPress Plugin Development
 
How to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginHow to Create a Custom WordPress Plugin
How to Create a Custom WordPress Plugin
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Intro to WordPress Plugins
Intro to WordPress PluginsIntro to WordPress Plugins
Intro to WordPress Plugins
 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Developing WordPress Plugins : For Begineers
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For Begineers
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
5 Steps to Develop a WordPress Plugin From Scratch.pdf
5 Steps to Develop a WordPress Plugin From Scratch.pdf5 Steps to Develop a WordPress Plugin From Scratch.pdf
5 Steps to Develop a WordPress Plugin From Scratch.pdf
 
WordPress Plugin Development
WordPress Plugin DevelopmentWordPress Plugin Development
WordPress Plugin Development
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress plugin
 
Introduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentIntroduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin Development
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
Kick start your career with wordpress
Kick start your career with wordpressKick start your career with wordpress
Kick start your career with wordpress
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training module
 
Building your first plugin
Building your first pluginBuilding your first plugin
Building your first plugin
 
Extending WordPress - a guide to building your first plugin
Extending WordPress -  a guide to building your first pluginExtending WordPress -  a guide to building your first plugin
Extending WordPress - a guide to building your first plugin
 

Último

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Último (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

WordPress plugins

  • 1. How to create a WordPress plugin. WordCamp Toronto Dev 2012 @thisismyurl
  • 2. What is a Plugin? A WordPress plugin is a PHP based addition to the WordPress blogging platform. • Plugins are functions which interact with WordPress Core code; • A Plugin changes what WordPress does; • Plugins are stored external of the theme;
  • 3. What can they do? Since Plugins are executed as part of the WordPress platform, they’re almost limitless. • Plugins can interact with WordPress via Hooks and Actions; • They can create, or interact with API’s in the WordPress system; • Plugins can affect Posts, Pages, Users, or any part of the WordPress tool;
  • 4. When should you use a Plugin? Plugin functions can be stored as a plugin, or in a theme function.php file, why choose? • Functions are specifically part of the theme; • Plugins allow you to share code outside a theme, across multiple designs; • Plugins can be activated in multisite environments;
  • 5. Theme functions are restricted to a single theme. Plugins deliver the same code to multiple blogs, on the same server or across multiple hosting accounts.
  • 6. How WordPress finds a Plugin WordPress will automatically locate plugins on a standard install, adding them to the admin • /wp-content/plugins/filename.php • /wp-content/plugins/folder-name/filename.php • WordPress will search one level deep in the plugins folder; • Searches for .php files with a valid plugin header;
  • 10. Play nice with other functions Remember WordPress shares your plugin functions across the entire site, be unique • Your plugins should use a unique name for all functions; • function demo_plugin_function_name() for example; • Plugin file load order is determined by WordPress;
  • 11. What are Actions? Actions are triggered by WordPress, causing your plugin to spring to life. • There’s an action for almost everything WordPress does • http://codex.wordpress.org/Plugin_API/Action_Reference
  • 12. What are Filters? Filters allow you to change content WordPress has created. • There’s an filter for almost everything WordPress does • http://codex.wordpress.org/Plugin_API
  • 13. Building a Plugin Let’s get started with something basic.
  • 16. Adding a link items to the Plugins page list
  • 17. Adding an item to the Settings menu
  • 19. Adding items to the settings page
  • 24. A standard WordPress function, calling settings
  • 27. How to uninstall the data from your plugin • Stored separately in an uninstall.php file.
  • 28. Plugin Best Practises Some ideas on how to do it right.
  • 29. Be unique. Remember Plugins interact will all the code on your WordPress website, make sure you’re unique. • Classes and Functions should use unique names; • thisismyurl_plugin_name_function_name() for example;
  • 30. Be descriptive. Your Plugin is part of something else, make sure people can easily understand your code. • Elements should use verbose naming conventions, easy to understand; • $i is bad; • $loop_resume_posts is good;
  • 31. Be consistent. There are standards in the WordPress community, following them makes it easy. • The WordPress coding standards make coding easier in the long run; • If you’re following your own coding standards, stick to them; • http://codex.wordpress.org/WordPress_Coding_Standards
  • 32. Be lazy, but smart. In my experience, somebody else has already done a lot of the heavy lifting so look before you code.
  • 34. Be respectful. Some authors like to work on their plugins alone. If you’d like to help, ask.
  • 35. Fork it. All plugins on WordPress.org are released under the GNU licensing terms, if you can’t collaborate, innovate.
  • 36. Give Back. If you’ve written a WordPress Plugin that you think the community will benefit from, submit it to WordPress.org for review and consideration.