SlideShare a Scribd company logo
Build your own Plugin
Build your own WordPress Plugin




       Speaker
       Alexandre Marreiros
       Tech Trainner and Speaker and Consultnat as Independent
       CTO Innovagency
       Contacts
        @alexmarreiros | amarreiros@gmail.com
        digitalmindignition.com
Build your own WordPress Plugin




        Plugin
        “Plug-ins are a great way to enhance the
        functionality of your blog or WebSite by adding
        in extra features. These can be placed
        anywhere inside your template by function
        hooks. Over time the extensibility of WordPress’
        plug-in system has allow tremendous growth
        and hundreds of developer-submitted pieces of
        software.”
Build your own WordPress Plugin




        What i need to build plugin’s
        Knowledge of PHP (Rudimentar)

        Basic understanding of the WordPress file
         structure

        Good Ideias or problems
Build your own WordPress Plugin




        Why Build Plugin’s
        When you need to solve a recorrent
         WordPress development need

        When you need to extende the plataform

        To a better understaning of the WordPress
         Backend
Build your own WordPress Plugin




        Where Plugin’s Live?
Build your own WordPress Plugin




        Best Pratice 1
        Give a “Home” to your Plugin this way you
         simplify Plugin file system struture




        Create a readme.txt file to explain who are
         the person who knows how the Plugin is
         built
Build your own WordPress Plugin




       To Start
        Create the base PHP file for your Plugin

        You must start with the plugin declaration
Build your own WordPress Plugin




        2 Build Aproaches
        Create an entire class system to avoid
         collisions with functions and variable names
         that already exist.

        just write your code in sample functions.
Build your own WordPress Plugin




        Best Pratice 2
        Don’t do Suicide if your plugin is simple
         don’t start building a entire new class
         ecosystem for him.
Build your own WordPress Plugin




        Best Pratice 3

        To avoid duplication use prefixing labels to
         all your variables and function names.
Build your own WordPress Plugin




        Actions and Filters
        “Actions and Filters allow for plug-in
        developers to update bits of code throughout
        the WordPress admin panel pertaining to
        your new plug-in. This means you could add
        a new tab in the sidebar or additional
        settings links for your Plug-in options.”
Build your own WordPress Plugin




        Filter
        A filter is used on data being passed into
         WordPress. With filters you are quite literally
         able to filter content through your own custom
         written functions to change data in any way.


        Used in cases like writing a sidebar widgets or
         smaller functions to change how a post should
         be displayed.
Build your own WordPress Plugin




        Actions
        Target pre-defined areas in your templates
         and admin panel. Is important if your Plugin
         intend to be triggered when something
         happens in your WordPress event Pipeline.
           publish_post – called when a post is published or when status is
           changed into “published”
           save_post – called when a post/page is created from start or updated
           wp_head – called when the template is loaded and runs
           the wp_head() function
           loop_end – called immediately after the final post has been processed
           through the WordPress loop
           trackback_post – called whenever a new trackback is added into a post
Build your own WordPress Plugin




        Plugin Registering
                                  Plugin Creates      Register
          Plugin is
                                   his Hooks in    functions as a
          installed
                                        WP         Action Listener




                                      Plugin is       Register
                                    “hooked” to    functions as a
                                    WordPress       Filter Listen
Build your own WordPress Plugin




        When Plugin is Called
            Wordpress                Wordpress
           executes an             Validates all the
        action or render s        register functions




           Call Plugins
            functions
          (considering
        registering order)
Build your own WordPress Plugin




        Best Pratice 4

        Be carefull not to destruct what plugin’s that
         came before you had made.
Build your own WordPress Plugin




        Demo
Build your own WordPress Plugin




        Questions
            Your turn to Talk

        Resources
            http://codex.wordpress.org/Writing_a_Plugin
            Professional WordPress Plugin
             Development by Brad Williams, Ozh Richard and
             Justin Tadlock
            WordPress 3 Plugin Development Essentials by
             B Bondari and E Griffiths (24 Mar 2011)
Wordcamp2012 build your plugin

More Related Content

What's hot

Shared Hosting and WordPress
Shared Hosting and WordPressShared Hosting and WordPress
Shared Hosting and WordPress
Al Davis
 
SELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UISELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UI
Manasa Dilipkumar
 

What's hot (18)

How to be a Super Super-Admin - WCMTL 2014
How to be a Super Super-Admin - WCMTL 2014How to be a Super Super-Admin - WCMTL 2014
How to be a Super Super-Admin - WCMTL 2014
 
WordPress 3.4 Preview
WordPress 3.4 PreviewWordPress 3.4 Preview
WordPress 3.4 Preview
 
The Basics of WordPress
The Basics of WordPressThe Basics of WordPress
The Basics of WordPress
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Apache
ApacheApache
Apache
 
After the install
After the installAfter the install
After the install
 
10 Free Useful Plugins for Bloggers
10 Free Useful Plugins for Bloggers10 Free Useful Plugins for Bloggers
10 Free Useful Plugins for Bloggers
 
Sexy, Powerful, Exciting
Sexy, Powerful, ExcitingSexy, Powerful, Exciting
Sexy, Powerful, Exciting
 
Use case 1 - for Sitecore Automation Module
Use case 1 - for Sitecore Automation ModuleUse case 1 - for Sitecore Automation Module
Use case 1 - for Sitecore Automation Module
 
Shared Hosting and WordPress
Shared Hosting and WordPressShared Hosting and WordPress
Shared Hosting and WordPress
 
So many-plugins-ri2017
So many-plugins-ri2017So many-plugins-ri2017
So many-plugins-ri2017
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
 
SELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UISELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UI
 
Word press 4.4 what’s new?
Word press 4.4   what’s new?Word press 4.4   what’s new?
Word press 4.4 what’s new?
 
10 Must-Have WordPress Plugins
10 Must-Have WordPress Plugins10 Must-Have WordPress Plugins
10 Must-Have WordPress Plugins
 
WordPress Seminar
WordPress SeminarWordPress Seminar
WordPress Seminar
 
WordCamp KC WordPress Basics
WordCamp KC WordPress BasicsWordCamp KC WordPress Basics
WordCamp KC WordPress Basics
 
Cross browser testing
Cross browser testingCross browser testing
Cross browser testing
 

Viewers also liked (8)

Linq view part1
Linq view part1Linq view part1
Linq view part1
 
De cómo la tecnología no logra integrarse en la escuela a menos que grso 2004
De cómo la tecnología no logra integrarse en la escuela a menos que grso 2004De cómo la tecnología no logra integrarse en la escuela a menos que grso 2004
De cómo la tecnología no logra integrarse en la escuela a menos que grso 2004
 
Fatma cakir2
Fatma cakir2Fatma cakir2
Fatma cakir2
 
Windows8.1overviewnetponto
Windows8.1overviewnetpontoWindows8.1overviewnetponto
Windows8.1overviewnetponto
 
Digital governance in municipalities worldwide • 2005 mark h olsen y seang ...
Digital governance in municipalities worldwide • 2005  mark h olsen y  seang ...Digital governance in municipalities worldwide • 2005  mark h olsen y  seang ...
Digital governance in municipalities worldwide • 2005 mark h olsen y seang ...
 
La encuesta
La encuestaLa encuesta
La encuesta
 
8539300 english
8539300 english8539300 english
8539300 english
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Similar to Wordcamp2012 build your plugin

Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
Tom Jenkins
 
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
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 

Similar to Wordcamp2012 build your plugin (20)

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
 
WordPress Bootcamp Part 2 - Extending WordPress
WordPress Bootcamp Part 2 - Extending WordPressWordPress Bootcamp Part 2 - Extending WordPress
WordPress Bootcamp Part 2 - Extending WordPress
 
Word press Plugins by WordPress Experts
Word press Plugins by WordPress ExpertsWord press Plugins by WordPress Experts
Word press Plugins by WordPress Experts
 
Wordpress
Wordpress Wordpress
Wordpress
 
Wordpress
WordpressWordpress
Wordpress
 
Wordpress For Begineer
Wordpress For BegineerWordpress For Begineer
Wordpress For Begineer
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
 
WordPress plugins
WordPress pluginsWordPress plugins
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
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
 
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
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
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
 
Wordpress Tech Talk at Atlogys
Wordpress Tech Talk at AtlogysWordpress Tech Talk at Atlogys
Wordpress Tech Talk at Atlogys
 
Wordpress Tech Talk
Wordpress Tech Talk Wordpress Tech Talk
Wordpress Tech Talk
 
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
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Wordpress
WordpressWordpress
Wordpress
 
Using Wordpress for Internet Publishing
Using Wordpress for Internet PublishingUsing Wordpress for Internet Publishing
Using Wordpress for Internet Publishing
 

More from Alexandre Marreiros

More from Alexandre Marreiros (20)

Agular fromthetrenches2netponto
Agular fromthetrenches2netpontoAgular fromthetrenches2netponto
Agular fromthetrenches2netponto
 
Whats a Chat bot
Whats a Chat botWhats a Chat bot
Whats a Chat bot
 
Type of angular 2
Type of angular 2Type of angular 2
Type of angular 2
 
Xamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsXamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected apps
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a couple
 
Angular 2
Angular 2Angular 2
Angular 2
 
Jws masterclass progressive web apps
Jws masterclass progressive web appsJws masterclass progressive web apps
Jws masterclass progressive web apps
 
Xamarin.forms
Xamarin.forms Xamarin.forms
Xamarin.forms
 
Quick View of Angular JS for High School
Quick View of Angular JS for High SchoolQuick View of Angular JS for High School
Quick View of Angular JS for High School
 
Pt xug xamarin pratices on big ui consumer apps
Pt xug  xamarin pratices on big ui consumer appsPt xug  xamarin pratices on big ui consumer apps
Pt xug xamarin pratices on big ui consumer apps
 
Get satrted angular js day 2
Get satrted angular js day 2Get satrted angular js day 2
Get satrted angular js day 2
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
 
Gab2015 azure search as a service
Gab2015 azure search as a serviceGab2015 azure search as a service
Gab2015 azure search as a service
 
Pragmatic responsive web design industry session 7
Pragmatic responsive web design   industry session 7Pragmatic responsive web design   industry session 7
Pragmatic responsive web design industry session 7
 
Boot strapandresponsiveintro
Boot strapandresponsiveintroBoot strapandresponsiveintro
Boot strapandresponsiveintro
 
WebSite development using WinJS
WebSite development using WinJSWebSite development using WinJS
WebSite development using WinJS
 
Universal Apps Development using HTML 5 and WINJS
Universal Apps Development using HTML 5 and WINJSUniversal Apps Development using HTML 5 and WINJS
Universal Apps Development using HTML 5 and WINJS
 
GWAB Mobile Services
GWAB Mobile ServicesGWAB Mobile Services
GWAB Mobile Services
 
Html5ignition newweborder
Html5ignition newweborderHtml5ignition newweborder
Html5ignition newweborder
 
Windows8.1 html5 dev paradigm discussion netponto
Windows8.1 html5 dev paradigm discussion netpontoWindows8.1 html5 dev paradigm discussion netponto
Windows8.1 html5 dev paradigm discussion netponto
 

Wordcamp2012 build your plugin

  • 1. Build your own Plugin
  • 2. Build your own WordPress Plugin Speaker Alexandre Marreiros Tech Trainner and Speaker and Consultnat as Independent CTO Innovagency Contacts @alexmarreiros | amarreiros@gmail.com digitalmindignition.com
  • 3. Build your own WordPress Plugin Plugin “Plug-ins are a great way to enhance the functionality of your blog or WebSite by adding in extra features. These can be placed anywhere inside your template by function hooks. Over time the extensibility of WordPress’ plug-in system has allow tremendous growth and hundreds of developer-submitted pieces of software.”
  • 4. Build your own WordPress Plugin What i need to build plugin’s Knowledge of PHP (Rudimentar) Basic understanding of the WordPress file structure Good Ideias or problems
  • 5. Build your own WordPress Plugin Why Build Plugin’s When you need to solve a recorrent WordPress development need When you need to extende the plataform To a better understaning of the WordPress Backend
  • 6. Build your own WordPress Plugin Where Plugin’s Live?
  • 7. Build your own WordPress Plugin Best Pratice 1 Give a “Home” to your Plugin this way you simplify Plugin file system struture Create a readme.txt file to explain who are the person who knows how the Plugin is built
  • 8. Build your own WordPress Plugin To Start Create the base PHP file for your Plugin You must start with the plugin declaration
  • 9. Build your own WordPress Plugin 2 Build Aproaches Create an entire class system to avoid collisions with functions and variable names that already exist. just write your code in sample functions.
  • 10. Build your own WordPress Plugin Best Pratice 2 Don’t do Suicide if your plugin is simple don’t start building a entire new class ecosystem for him.
  • 11. Build your own WordPress Plugin Best Pratice 3 To avoid duplication use prefixing labels to all your variables and function names.
  • 12. Build your own WordPress Plugin Actions and Filters “Actions and Filters allow for plug-in developers to update bits of code throughout the WordPress admin panel pertaining to your new plug-in. This means you could add a new tab in the sidebar or additional settings links for your Plug-in options.”
  • 13. Build your own WordPress Plugin Filter A filter is used on data being passed into WordPress. With filters you are quite literally able to filter content through your own custom written functions to change data in any way. Used in cases like writing a sidebar widgets or smaller functions to change how a post should be displayed.
  • 14. Build your own WordPress Plugin Actions Target pre-defined areas in your templates and admin panel. Is important if your Plugin intend to be triggered when something happens in your WordPress event Pipeline. publish_post – called when a post is published or when status is changed into “published” save_post – called when a post/page is created from start or updated wp_head – called when the template is loaded and runs the wp_head() function loop_end – called immediately after the final post has been processed through the WordPress loop trackback_post – called whenever a new trackback is added into a post
  • 15. Build your own WordPress Plugin Plugin Registering Plugin Creates Register Plugin is his Hooks in functions as a installed WP Action Listener Plugin is Register “hooked” to functions as a WordPress Filter Listen
  • 16. Build your own WordPress Plugin When Plugin is Called Wordpress Wordpress executes an Validates all the action or render s register functions Call Plugins functions (considering registering order)
  • 17. Build your own WordPress Plugin Best Pratice 4 Be carefull not to destruct what plugin’s that came before you had made.
  • 18. Build your own WordPress Plugin Demo
  • 19. Build your own WordPress Plugin Questions  Your turn to Talk Resources  http://codex.wordpress.org/Writing_a_Plugin  Professional WordPress Plugin Development by Brad Williams, Ozh Richard and Justin Tadlock  WordPress 3 Plugin Development Essentials by B Bondari and E Griffiths (24 Mar 2011)