SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
Write your first WordPress Plugin
    Ibrahim Abdel Fattah Mohamed, aka bingorabbit
                  www.bingorabbit.com
                  Twitter: @bingorabbit
               .. and I HEART WordPress
Agenda
● What is a WordPress Plugin?
● Why do I need to write a WordPress Plugin?

● Plugin files structure and headers.

● How to add my plugin to my WordPress Blog.

● How to contribute to WordPress Development?

● Questions..
What is a WordPress Plugin?

A piece of code, written to solve a problem or to
 add a specific functionality that is not there.
Why do I need to write a WordPress Plugin?

 ● Solving a problem.
 ● Add new functionality

 ● You love it, but have a better implementation?

 ● Modify it, extend it

 ● Want to make money?
How can I write a plugin?

● Find a problem you need to solve, or
  something new to add.
● Warm your hands.

● Choose a descriptive name.

● Document every little thing.

● Think about the license.

● Then start coding it..
Structure

Wordpress/
   |- wp-content/
      |- plugins/
        |- YourPlugin/
           |- mainfile.php
           |- js/
           |- css/
           |- php/
Headers

<?php
   /*
   Plugin Name: Your desired name
   Plugin URI: http://path.to/plugin/
   Description: What does it actually do?
   Version: x.Y
   Author: This should be you
   Author URI: http://path.to/you/
   */
?>
Hooks
● Hooks are just..hooks..
● Used to attach your plugin to a working system.

● Two types of Hook; Actions and Filters
Actions
● Actions, are just actions..
● Actions triggers an event or a function.

● When a post is published (action), send an email

  to the administrator (function, event or reaction).

add_action('hook_name',
 'your_function_name', [priority],
 [accepted_args]);
Filters
    Database/User <----> Filters <----> Data

● Filters are also just..Filters..
● Example, add some text just after every post.




add_filter('hook_name',
 'your_function_name', [priority],
 [accepted_args]);
Sample Plugin:
Email Friends on New Post
Important Links
●   Writing a Plugin (
  http://codex.wordpress.org/Writing_a_Plugin)
● Plugin API (http://codex.wordpress.org/Plugin_API)

● Actions Reference (

  http://codex.wordpress.org/Plugin_API/Action_Reference)
● Filters Reference (

  http://codex.wordpress.org/Plugin_API/Filter_Reference)
● WordPress Coding Standards (

  http://codex.wordpress.org/WordPress_Coding_Standards)
Contributing to WordPress..
Why?
● Improve the software you use..
● Being a part of the community, learning and

  experience.
Where?
●   Documentation, aka Codex (
  http://codex.wordpress.org/Codex:Contributing)
● Translation (

  http://codex.wordpress.org/Translating_WordPress)
● Support Forum (http://www.wordpress.org/support)

● IRC Channel (#WordPress-dev on Freenode)

● Development (Next Slide?)
How?
  ● Trac (http://trac.wordpress.org/)
  ● Code it, refine it, or just test it..

  ● Got a bug? Go and report it..




http://wordpress.org/development/2009/03/contributing-to-wordpress-part-i-development/
Any Questions?..
Thanks!..
Ibrahim Abdel Fattah Mohamed
       www.bingorabbit.com
       www.catreloaded.net

Más contenido relacionado

La actualidad más candente

Behavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with BehatBehavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with Behat
imoneytech
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
henri_makembe
 

La actualidad más candente (20)

Child Themes in WordPress
Child Themes in WordPressChild Themes in WordPress
Child Themes in WordPress
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPress
 
Rebrand WordPress Admin
Rebrand WordPress AdminRebrand WordPress Admin
Rebrand WordPress Admin
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Behavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with BehatBehavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with Behat
 
Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?Theming in WordPress - Where do I Start?
Theming in WordPress - Where do I Start?
 
WordPress plugins
WordPress pluginsWordPress plugins
WordPress plugins
 
The Future Of WordPress Presentation
The Future Of WordPress PresentationThe Future Of WordPress Presentation
The Future Of WordPress Presentation
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Intrebari Hydro
Intrebari HydroIntrebari Hydro
Intrebari Hydro
 
WordPress Plugins
WordPress PluginsWordPress Plugins
WordPress Plugins
 
How I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPressHow I Learned to Stop Worrying and Backup WordPress
How I Learned to Stop Worrying and Backup WordPress
 
How to WordPress: the basics, part 1
How to WordPress:  the basics, part 1How to WordPress:  the basics, part 1
How to WordPress: the basics, part 1
 
Word press Plugins by WordPress Experts
Word press Plugins by WordPress ExpertsWord press Plugins by WordPress Experts
Word press Plugins by WordPress Experts
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
 
Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?Shortcodes vs Widgets: Which one and how?
Shortcodes vs Widgets: Which one and how?
 

Destacado

Destacado (7)

WordPress Customizer
WordPress CustomizerWordPress Customizer
WordPress Customizer
 
Modern Web Applications using AngularJS
Modern Web Applications using AngularJSModern Web Applications using AngularJS
Modern Web Applications using AngularJS
 
Rails course day 4
Rails course day 4Rails course day 4
Rails course day 4
 
Rails course day 5
Rails course day 5Rails course day 5
Rails course day 5
 
WordPress customizer for themes and more
WordPress customizer for themes and moreWordPress customizer for themes and more
WordPress customizer for themes and more
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
Ionic Hybrid Mobile Application
Ionic Hybrid Mobile ApplicationIonic Hybrid Mobile Application
Ionic Hybrid Mobile Application
 

Similar a Write Your First WordPress Plugin

Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 
Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
Mainak Goswami
 
WordPress Plugins
WordPress PluginsWordPress Plugins
WordPress Plugins
randyhoyt
 
Creating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPressCreating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPress
Hristo Chakarov
 

Similar a Write Your First WordPress Plugin (20)

Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Developing WordPress Plugins
Developing WordPress PluginsDeveloping WordPress Plugins
Developing 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
 
Extending WordPress
Extending WordPressExtending WordPress
Extending WordPress
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
 
Developing WordPress Plugins : For Begineers
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For Begineers
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
Faster WordPress Workflows
Faster WordPress WorkflowsFaster WordPress Workflows
Faster WordPress Workflows
 
WordPress Plugins
WordPress PluginsWordPress Plugins
WordPress Plugins
 
WordPress Plugin Development For Beginners
WordPress Plugin Development For BeginnersWordPress Plugin Development For Beginners
WordPress Plugin Development For Beginners
 
WordPress
WordPressWordPress
WordPress
 
Intro to Plugin Development, Miami WordCamp, 2015
Intro to Plugin Development, Miami WordCamp, 2015Intro to Plugin Development, Miami WordCamp, 2015
Intro to Plugin Development, Miami WordCamp, 2015
 
Creating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPressCreating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPress
 
Learning Wordpress - the internal guide
Learning Wordpress - the internal guideLearning Wordpress - the internal guide
Learning Wordpress - the internal guide
 
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
 

Más de Ibrahim Abdel Fattah Mohamed

Más de Ibrahim Abdel Fattah Mohamed (13)

dubizzle's Guide to RabbitMQ
dubizzle's Guide to RabbitMQdubizzle's Guide to RabbitMQ
dubizzle's Guide to RabbitMQ
 
HTML5
HTML5HTML5
HTML5
 
Desk2Me Pitch
Desk2Me PitchDesk2Me Pitch
Desk2Me Pitch
 
CAT, Your dreams start here
CAT, Your dreams start hereCAT, Your dreams start here
CAT, Your dreams start here
 
Map Your MIInd
Map Your MIIndMap Your MIInd
Map Your MIInd
 
IT Career Planning v2
IT Career Planning v2IT Career Planning v2
IT Career Planning v2
 
Java Based RFID Attendance Management System Graduation Project Presentation
Java Based RFID Attendance Management System Graduation Project PresentationJava Based RFID Attendance Management System Graduation Project Presentation
Java Based RFID Attendance Management System Graduation Project Presentation
 
IT Career Planning
IT Career PlanningIT Career Planning
IT Career Planning
 
Map your Mind, Your mind on a paper
Map your Mind, Your mind on a paperMap your Mind, Your mind on a paper
Map your Mind, Your mind on a paper
 
Web 3.0
Web 3.0Web 3.0
Web 3.0
 
Keynote by Jane Wells
Keynote by Jane WellsKeynote by Jane Wells
Keynote by Jane Wells
 
Getting Started: The Environment
Getting Started: The EnvironmentGetting Started: The Environment
Getting Started: The Environment
 
Getting Started: The Installation
Getting Started: The InstallationGetting Started: The Installation
Getting Started: The Installation
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Write Your First WordPress Plugin

  • 1. Write your first WordPress Plugin Ibrahim Abdel Fattah Mohamed, aka bingorabbit www.bingorabbit.com Twitter: @bingorabbit .. and I HEART WordPress
  • 2. Agenda ● What is a WordPress Plugin? ● Why do I need to write a WordPress Plugin? ● Plugin files structure and headers. ● How to add my plugin to my WordPress Blog. ● How to contribute to WordPress Development? ● Questions..
  • 3. What is a WordPress Plugin? A piece of code, written to solve a problem or to add a specific functionality that is not there.
  • 4. Why do I need to write a WordPress Plugin? ● Solving a problem. ● Add new functionality ● You love it, but have a better implementation? ● Modify it, extend it ● Want to make money?
  • 5. How can I write a plugin? ● Find a problem you need to solve, or something new to add. ● Warm your hands. ● Choose a descriptive name. ● Document every little thing. ● Think about the license. ● Then start coding it..
  • 6. Structure Wordpress/ |- wp-content/ |- plugins/ |- YourPlugin/ |- mainfile.php |- js/ |- css/ |- php/
  • 7. Headers <?php /* Plugin Name: Your desired name Plugin URI: http://path.to/plugin/ Description: What does it actually do? Version: x.Y Author: This should be you Author URI: http://path.to/you/ */ ?>
  • 8. Hooks ● Hooks are just..hooks.. ● Used to attach your plugin to a working system. ● Two types of Hook; Actions and Filters
  • 9. Actions ● Actions, are just actions.. ● Actions triggers an event or a function. ● When a post is published (action), send an email to the administrator (function, event or reaction). add_action('hook_name', 'your_function_name', [priority], [accepted_args]);
  • 10. Filters Database/User <----> Filters <----> Data ● Filters are also just..Filters.. ● Example, add some text just after every post. add_filter('hook_name', 'your_function_name', [priority], [accepted_args]);
  • 12. Important Links ● Writing a Plugin ( http://codex.wordpress.org/Writing_a_Plugin) ● Plugin API (http://codex.wordpress.org/Plugin_API) ● Actions Reference ( http://codex.wordpress.org/Plugin_API/Action_Reference) ● Filters Reference ( http://codex.wordpress.org/Plugin_API/Filter_Reference) ● WordPress Coding Standards ( http://codex.wordpress.org/WordPress_Coding_Standards)
  • 14. Why? ● Improve the software you use.. ● Being a part of the community, learning and experience.
  • 15. Where? ● Documentation, aka Codex ( http://codex.wordpress.org/Codex:Contributing) ● Translation ( http://codex.wordpress.org/Translating_WordPress) ● Support Forum (http://www.wordpress.org/support) ● IRC Channel (#WordPress-dev on Freenode) ● Development (Next Slide?)
  • 16. How? ● Trac (http://trac.wordpress.org/) ● Code it, refine it, or just test it.. ● Got a bug? Go and report it.. http://wordpress.org/development/2009/03/contributing-to-wordpress-part-i-development/
  • 18. Thanks!.. Ibrahim Abdel Fattah Mohamed www.bingorabbit.com www.catreloaded.net