SlideShare une entreprise Scribd logo
1  sur  71
Télécharger pour lire hors ligne
“Intro to WordPress Plugin
 Development”

Before we begin please:
  Connect to the internet
  Grab the slides from:
       http://www.slideshare.net/r3df


Rick Radko                                  WordCamp Toronto
r3df.com                                 September 30th, 2012
A little bit about me

Rick Radko – R-Cubed Design Forge
   Software, web and app designer/developer.
   Creating custom web sites since 1996.
   Artistic and creative engineer.
   Co-organizer of: The Ottawa WordPress Group.
   If you have questions or need help, contact me
    at: wpinfo@r3df.com.

Slides are posted at:
   http://www.slideshare.net/r3df
© 2012 Rick Radko, r3df.com                          1
About this talk

This is a hands on workshop.

If you don’t have access to a WordPress site, you can also
follow along now and do the workshop later.

To work along hands on:
        You will need access to your hosting account and a
          WordPress website. (sites on wordpress.com will not work)
       Or
        A local server, with a WordPress site, on your laptop.


No coding experience is required to do this workshop.
© 2012 Rick Radko, r3df.com                                           2
Goals

In this workshop I will walk run through a reconstruction
of a plugin I published on wordpress.org.
   With only 45 minutes, the intent is exposure to concepts
    and ideas, not deep understanding.
   There is tons of material on the net to gain deeper
    understanding at a more leisurely pace.

At the end of this presentation you should have:
   Some understanding of how my example plugin works.
   Some experience to start you down the road of plugin
    development.
   Links and pointers to reference material to take you
    further down the road.
© 2012 Rick Radko, r3df.com                                    3
What is a plugin?

Plugins are blocks of code added to WordPress to
extend, or change the functionality of:
   WordPress
   Other plugins
   Themes




© 2012 Rick Radko, r3df.com                        4
More about plugins

Plugins:
   Are written in PHP.
         Can be a couple lines of code.
         Or 10,000 lines of code.
   Make use of WordPress API’s.
   Will likely have some HTML and CSS.
   May access MySQL.
   May use some JavaScript.



© 2012 Rick Radko, r3df.com                5
Lets create a plugin

We could create a “Hello World” widget for our
sidebar:




                              But that’s not very
                              useful, or interesting.

© 2012 Rick Radko, r3df.com                             6
Meetup Widget

With a few more lines of code we can have:




© 2012 Rick Radko, r3df.com                  7
Tools to use for programming

Programming editors:
   Code completion
   Syntax highlighting
   Bracket matching
   “Light” and fast




   Windows: Notepad++, Sublime Text $$
   Mac: TextWrangler, Coda $$, Sublime Text $$
© 2012 Rick Radko, r3df.com                       8
More tools

IDE – Integrated Development Environment
   NetBeans, Eclipse, Aptana, PhpStorm $,
    Komodo $, + more
   Cross platform - Java
   Do a lot more than a programming editor
         Integrated debugging
         Profiling
   “Heavier”

Jeremy Clarke: Code Faster and Smarter PHP with
IDE’s Like NetBeans
© 2012 Rick Radko, r3df.com                       9
A place to work

Development “Dev” site:
   Safe place to work that won’t disturb a live site.
   Does not matter if you WSOD the site.

   2 Common options:
         Sub-domain on your hosted site.
         “Local” web server on your pc/laptop.
              Requires some set-up – lots of tutorials on net.
              No internet connection needed.
              Fast, no internet lag, no FTP.
              BitNami, XAMPP, Wamp, Mamp.
© 2012 Rick Radko, r3df.com                                       10
Not at WordCamp Toronto?

If you are doing this workshop on your own, it is
recommended that you set-up:
   A local server.
OR
   A site on a sub-domain on your hosting.

Lots of resources online, here are a couple for
local servers from the codex:
   http://codex.wordpress.org/User:Beltranrubo/BitNami
   http://codex.wordpress.org/Installing_WordPress_Loc
    ally_on_Your_Mac_With_MAMP
© 2012 Rick Radko, r3df.com                           11
For the live workshop – we’re taking a shortcut

I’m going to demonstrate using the cPanel File
Manager and Editor on my hosting account.
   If you want to work along:
         Please login to your hosting account if you have not
          already.
         Please login to your WordPress admin.
   Use any non-critical hosted site you have.
         We may cause it to be messed up briefly.
         The site cannot be on wordpress.com, you cannot
          add plugins there.

© 2012 Rick Radko, r3df.com                                      12
Available tools

This is certainly not the best way to build a plugin,
but it is:
   The easiest way for us to get going without
    installing or setting up anything.
   Feel free to use a WordPress site on a local server
    if you have one set-up on your laptop.

We also won’t need a programming editor or IDE
for the workshop.
For the workshop to work, please enter all the text
exactly as illustrated.
© 2012 Rick Radko, r3df.com                               13
Log into your hosting account




© 2012 Rick Radko, r3df.com     14
Open File Manager




© 2012 Rick Radko, r3df.com   15
File Manager Popup

If you see this popup, make sure you have “Web
Root” selected and then hit go.




© 2012 Rick Radko, r3df.com                      16
Path to plugins

Navigate to the plugin folder.




© 2012 Rick Radko, r3df.com      17
Create a folder for the plugin




© 2012 Rick Radko, r3df.com      18
New folder name




                              Folder Name: r3df-meetup-widget
© 2012 Rick Radko, r3df.com                                     19
The new folder




© 2012 Rick Radko, r3df.com   20
Empty plugin folder




© 2012 Rick Radko, r3df.com   21
Create the main plugin file




© 2012 Rick Radko, r3df.com   22
The new file form




                              File Name: r3df-meetup-widget.php
© 2012 Rick Radko, r3df.com                                       23
The main plugin file




© 2012 Rick Radko, r3df.com   24
Open the file in the editor




© 2012 Rick Radko, r3df.com   25
The new and empty file




© 2012 Rick Radko, r3df.com   26
The file header – the only required part of a plugin
  <?php
  /*
  Plugin Name:           R3DF Meetup Widget
  Description:           Displays Meetup group link in a widget
  Plugin URI:            http://r3df.com/
  Version:               1.0 WC Demo
  Author:                R3DF
  Author URI:            http://r3df.com/
  Author email:          wpinfo@r3df.com
  */
  /* Plugin content here */

    Creates this plugin information on the Plugins page in the Dashboard




© 2012 Rick Radko, r3df.com                                                27
The plugin with header

Paste the header code from above, into the file.




Plugin header information:
   https://codex.wordpress.org/Writing_a_Plugin#File_Headers

© 2012 Rick Radko, r3df.com                                     28
Check out the plugin listing in your Dashboard




   Ignore the update message if you see one.
   Don’t activate it yet!
© 2012 Rick Radko, r3df.com                      29
Empty plugin template

We now have an empty plugin that could be used
as a template to:
   Make your own plugin. (a blank template)
         Change the file name, folder name and the header
          info: name, description, author, etc.
   Make a “Site Plugin” to add code to run on your
    site that is often put into functions.php. See:
         Don’t: “Just paste this code in your functions.php”
         or
         http://ottopress.com/2011/creating-a-site-specific-
           snippets-plugin/
© 2012 Rick Radko, r3df.com                                  30
Now lets make it do something

Copy and paste this code into your plugin
replacing /* Plugin content here */:
  class widget_r3dfmeetup extends WP_Widget {
     /* constructor */
  }
  add_action('widgets_init', create_function('', 'return register_widget("widget_r3dfmeetup");'));

A lot of the code you need to do things in
WordPress will start with:
   “boilerplate code” – code blocks that are needed
    and repeatedly reused with slight edits.

© 2012 Rick Radko, r3df.com                                                                          31
The class declaration
The line:
 class widget_r3dfmeetup extends WP_Widget {
   Creates a new object that lets us “extend” the
    WordPress class WP_Widget which does all the
    heavy lifting in creating a widget.


Codex: http://codex.wordpress.org/Widgets_API
API – Application Programming Interface
   Remote control for WordPress.
   Using the API your PHP tells WordPress to do stuff.
© 2012 Rick Radko, r3df.com                           32
Getting into the “action”

The line:
 add_action('widgets_init', create_function('', 'return register_widget(
    "widget_r3dfmeetup");‘ ));
   Tells WordPress to register our widget at the time
    it is setting up widgets - 'widgets_init'.
   You’ll see a line very similar to this for every widget
    declaration.
   To reuse the block of code we just pasted in you
    only need to change the name and the description.

Actions are very important to WordPress plugins.
© 2012 Rick Radko, r3df.com                                                33
WordPress actions

Actions are one of 2 types of WordPress “Hooks”.
   Specific events (100’s) trigger them, for example:
         Publishing a post or page
         Displaying a post, page or admin page.
         Displaying a menu.
         Displaying the page content.
         http://codex.wordpress.org/Plugin_API/Action_Reference
   Your plugin defines a function for WordPress to
    execute at the time the event occurs.
   Generally actions “do” things.
         Filters, which we will see later “change” things
© 2012 Rick Radko, r3df.com                                        34
Getting hooked on actions

  WP Native Dashboard Fix
   Moving the menu item was accomplished by hooking
    into the action ‘admin_bar_menu’.
   10 lines of code and you have a maintainable fix
    instead of hacked plugin.




© 2012 Rick Radko, r3df.com                            35
The widget “constructor function”

Paste the constructor function into your plugin
below the /* constructor */ line:
       function __construct() {
          $widget_options = array(
             'description' => 'Displays Meetup group link in a widget.',
          );
          $this->WP_Widget(false, $name = 'R3DF: Meetup Group Widget', $widget_options);
       }
       /* widget function */

   This code is required for a widget.
   Sets up the widget with a name and description.
   Just change the description and the name to reuse
    this block of code.
© 2012 Rick Radko, r3df.com                                                                36
An older style of constructor

Some tutorials and/or widgets may have:
  function <function name that matches class name>() {

   This is a older, PHP 4 style for constructors.
   The function name needs to match the class
    defined above.




© 2012 Rick Radko, r3df.com                              37
The widget function

Add this code after /* widget function */ line:
: function widget($args, $instance) {
     extract($args);
            echo $before_widget;
            $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
            if ( !empty($title) ) {
                echo $before_title . $title . $after_title;
            } ?>
            <a href="http://meetup.wptoronto.com/">The Toronto WordPress Group</a>
            <?php echo $after_widget;
       }
       /* form function */
   Everything but the red part is required for a widget,
    to add stuff around your widget content.
   The red part you can replace with your content.
© 2012 Rick Radko, r3df.com                                                                          38
Filters

“Filters” are the other “hook” type in WordPress.
Like actions:
   Specific events (100’s) trigger them.
         http://codex.wordpress.org/Plugin_API/Filter_Reference
   Your plugin defines a function for WordPress to
    execute at the time of the trigger.

Unlike actions:
   Filters change things, content passes through a
    filter function and must be returned, either
    updated/altered or unchanged.
© 2012 Rick Radko, r3df.com                                        39
Filtering the title

The apply_filters in our code block:
 $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
   The filter lets other plugins or code, add functions
    to change the title content.
   It’s important to have this code in the widget.
         If a theme were to rely on this filter to affect the way
          widget titles are shown, the site wouldn’t render
          correctly without it.




© 2012 Rick Radko, r3df.com                                                               40
The form function

Add this code after /* form function */ line:
: $title = esc_attr($instance['title']); ?>
  function form($instance) {
         <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php echo 'Title:'; ?>
         <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo
  $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
         </label></p>
         <?php
     }
      /* update function */

   This function creates the widget box you see in
    your dashboard in admin.
   The red part defines the HTML for your entry fields
    in the form. These can be copied from examples.
© 2012 Rick Radko, r3df.com                                                                         41
The update function

Add this code after /* update function */ line:
      function update($new_instance, $old_instance) {
         $instance = array();
         $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '') );
         $instance['title'] = strip_tags($new_instance['title']);
          return $instance;
      }

   This function saves the option data from the
    widget box you see in admin.
   It also is used to “clean” input that is provided.
           strip_tags removes HTML and PHP from the title.

© 2012 Rick Radko, r3df.com                                                               42
The plugin code




© 2012 Rick Radko, r3df.com   43
Activate the plugin




© 2012 Rick Radko, r3df.com   44
Plugin activated




© 2012 Rick Radko, r3df.com   45
Plugin not activated - error




   Debugging can be tricky, the line indicated for the
    error may be misleading, the error could be one or
    more lines above.
   If you can’t fix this, it’s ok, we’ll update the plugin in a
    few slides.
© 2012 Rick Radko, r3df.com                                        46
Add the widget to the sidebar

If your widget loaded, go to Appearance, and then
Widgets in your dashboard.




© 2012 Rick Radko, r3df.com                         47
Add a title if you want




© 2012 Rick Radko, r3df.com   48
The widget on the site

You now have a Meetup widget on your site.




© 2012 Rick Radko, r3df.com                  49
We have a widget that works, but…

At this point we have a basic widget.
   It has all the required elements for a widget.
   You could build new widgets by revising the key
    parts.

But, it’s not a great plugin:
   You need to edit the code to change the URL or
    the displayed text.
   It’s not very nice looking.
         We need to add an image and CSS.
   It would not be very good to give to other users.
© 2012 Rick Radko, r3df.com                             50
Pull the baked cake out of the oven

Properly adding things like:
   options for the URL and text to display.
   a Meetup logo.
   css loaded in the page header.
   internationalization.
starts to make things a bit more complicated.

So to save time, I’m going to do a cooking show
move here, and pull the baked “cake” out of the
oven.
© 2012 Rick Radko, r3df.com                       51
Get the final version from wordpress.org

Go to your dashboard, Plugins page:




© 2012 Rick Radko, r3df.com                52
Update successful

Once you see “Plugin updated successfully”:
   Go to the click on Appearance and then go to the
    Widgets page.




© 2012 Rick Radko, r3df.com                            53
Update the widget

Add the group name and URL in the new option
boxes & save.   Text: The Toronto WordPress Group
                              URL: http://meetup.wptoronto.com/




© 2012 Rick Radko, r3df.com                                       54
The new widget

Once you’ve hit save, take a look at your site:




   That’s more like it!
© 2012 Rick Radko, r3df.com                       55
Lets look at some of the new code

There are a lot more files and more code.
   Some of the files are needed only to put the plugin
    on wordpress.org.
   Sub-folders are added to keep things tidy.




© 2012 Rick Radko, r3df.com                           56
r3df-meetup-widget.php: Header and copyright

This is pretty much the same as we started with.
   Added the GPL copyright notice




© 2012 Rick Radko, r3df.com                        57
r3df-meetup-widget.php: Class and Constructor

We still have the same class statement.
   There two new sections in the constructor to load
    css and set a text domain.




© 2012 Rick Radko, r3df.com                             58
r3df-meetup-widget.php: Widget function

The widget function has had the content area
changed to allow for CSS styling, to add the image,
and the option ‘middle’ for single line display.




© 2012 Rick Radko, r3df.com                       59
r3df-meetup-widget.php: Form function

The form function has had blocks added for all of
the options. It’s also been internationalized.




© 2012 Rick Radko, r3df.com                         60
r3df-meetup-widget.php: Update function

The update function now handles all of the added
options.
   The wp_parse_args sets defaults and strips out
    unknown parameters.




© 2012 Rick Radko, r3df.com                          61
r3df-meetup-widget.php: added functions

Two new functions have been added
   One take care of loading the text domain – needed
    to use other languages.
   The other to put the CSS style sheet in the header.
We close with the same add_action we had




© 2012 Rick Radko, r3df.com                           62
uninstall.php

This added file runs if the plugin is uninstalled.
   It removes the settings that were saved in the
    database for the widget.
   Plugins should clean up after themselves.




© 2012 Rick Radko, r3df.com                          63
The added style sheet

Loaded into the page header.




© 2012 Rick Radko, r3df.com    64
Other possible plugin functions

Plugins can have:
   activation/deactivation routines
   menu items
   options pages




© 2012 Rick Radko, r3df.com            65
What next?

   Read some books – next couple of slides.
   Watch some WordCamp talks – next couple of
    slides.
   Read the codex:
         http://codex.wordpress.org/Writing_a_Plugin
         http://codex.wordpress.org/Plugin_Resources
         http://codex.wordpress.org/Developer_Documentation




© 2012 Rick Radko, r3df.com                                    66
Books - 1

Professional WordPress Plugin
Development
by: Brad Williams, Ozh Richard, Justin
Tadlock

Related WordCamp Presentations:
  http://www.slideshare.net/williams
   ba/create-your-first-wordpress-
   plugin



© 2012 Rick Radko, r3df.com              67
Books - 2

WordPress Plugin Development
Cookbook
by: Yannick Lefebvre

Related WordCamp videos:
    http://wordpress.tv/2011/08/16
     /yannick-lefebvre-plugin-
     development-demystified/
    http://wordpress.tv/2012/09/10
     /yannick-lefebvre-wordpress-
     plugin-development-201/
© 2012 Rick Radko, r3df.com           68
Books - 3

WordPress 3 Plugin Development
Essentials
by: Brian Bondari, Everett Griffiths




© 2012 Rick Radko, r3df.com            69
Contact


Rick Radko
  email: wpinfo@r3df.com
   twitter: @r3designforge


Slides at:
   www.slideshare.net/r3df




© 2012 Rick Radko, r3df.com   70

Contenu connexe

Tendances

Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Rakesh Kushwaha
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
Wordpress Command-Line
Wordpress Command-LineWordpress Command-Line
Wordpress Command-Linewpperu
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8Acquia
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentAizat Faiz
 
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Dat Hoang
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPressMicah Wood
 
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
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a proMarko Heijnen
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your pluginMarko Heijnen
 
Mage Titans USA 2016 M2 deployment
Mage Titans USA 2016  M2 deploymentMage Titans USA 2016  M2 deployment
Mage Titans USA 2016 M2 deploymentOlga Kopylova
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16tshellberg
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and BeyondScott Taylor
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesAcquia
 
Ppt full stack developer
Ppt full stack developerPpt full stack developer
Ppt full stack developerSudhirVarpe1
 
The Next Step in Responsive - RESS
The Next Step in Responsive - RESSThe Next Step in Responsive - RESS
The Next Step in Responsive - RESSAnthony Laurence
 
Grav CMS
Grav CMSGrav CMS
Grav CMSbtopro
 

Tendances (19)

Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Wordpress Command-Line
Wordpress Command-LineWordpress Command-Line
Wordpress Command-Line
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPress
 
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
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a pro
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
 
Mage Titans USA 2016 M2 deployment
Mage Titans USA 2016  M2 deploymentMage Titans USA 2016  M2 deployment
Mage Titans USA 2016 M2 deployment
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and Beyond
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
 
Ppt full stack developer
Ppt full stack developerPpt full stack developer
Ppt full stack developer
 
The Next Step in Responsive - RESS
The Next Step in Responsive - RESSThe Next Step in Responsive - RESS
The Next Step in Responsive - RESS
 
Grav CMS
Grav CMSGrav CMS
Grav CMS
 
WebMatrix
WebMatrixWebMatrix
WebMatrix
 

En vedette

Build your site tonight, be blogging tomorrow
Build your site tonight, be blogging tomorrowBuild your site tonight, be blogging tomorrow
Build your site tonight, be blogging tomorrowWarren Denley
 
Questions you’re too afraid to ask
Questions you’re too afraid to askQuestions you’re too afraid to ask
Questions you’re too afraid to askEric Mann
 
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV GGDBologna
 
Introducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemIntroducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemGGDBologna
 
how to not design like a developer
how to not design like a developerhow to not design like a developer
how to not design like a developertracy apps
 
SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)Ian Castro
 
Customize your theme using css
Customize your theme using cssCustomize your theme using css
Customize your theme using cssMichael Arestad
 
Customizing the custom loop wordcamp 2012-jeff
Customizing the custom loop   wordcamp 2012-jeffCustomizing the custom loop   wordcamp 2012-jeff
Customizing the custom loop wordcamp 2012-jeffAlexander Sapountzis
 
WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011Shayne Sanderson
 
Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Teresa Lane
 
Open Source Entrepreneurship
Open Source EntrepreneurshipOpen Source Entrepreneurship
Open Source EntrepreneurshipJimmy Rosén
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescueMarko Heijnen
 
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Kick Point
 
Responsive Images (STL WordCamp 2014)
Responsive Images (STL WordCamp 2014)Responsive Images (STL WordCamp 2014)
Responsive Images (STL WordCamp 2014)joemcgill
 
My first 3 months working with word press
My first 3 months working with word pressMy first 3 months working with word press
My first 3 months working with word pressNoe Lopez
 
Can You Go Commercial
Can You Go CommercialCan You Go Commercial
Can You Go Commercialgarthkoyle
 
Wordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesWordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesNick Coe
 
Design in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstlDesign in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstlWordCamp
 

En vedette (20)

Build your site tonight, be blogging tomorrow
Build your site tonight, be blogging tomorrowBuild your site tonight, be blogging tomorrow
Build your site tonight, be blogging tomorrow
 
Questions you’re too afraid to ask
Questions you’re too afraid to askQuestions you’re too afraid to ask
Questions you’re too afraid to ask
 
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
 
Introducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemIntroducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystem
 
how to not design like a developer
how to not design like a developerhow to not design like a developer
how to not design like a developer
 
SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)
 
Customize your theme using css
Customize your theme using cssCustomize your theme using css
Customize your theme using css
 
Customizing the custom loop wordcamp 2012-jeff
Customizing the custom loop   wordcamp 2012-jeffCustomizing the custom loop   wordcamp 2012-jeff
Customizing the custom loop wordcamp 2012-jeff
 
WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011
 
Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)
 
Open Source Entrepreneurship
Open Source EntrepreneurshipOpen Source Entrepreneurship
Open Source Entrepreneurship
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
Just Press Publish
Just Press PublishJust Press Publish
Just Press Publish
 
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
 
Responsive Images (STL WordCamp 2014)
Responsive Images (STL WordCamp 2014)Responsive Images (STL WordCamp 2014)
Responsive Images (STL WordCamp 2014)
 
My first 3 months working with word press
My first 3 months working with word pressMy first 3 months working with word press
My first 3 months working with word press
 
Can You Go Commercial
Can You Go CommercialCan You Go Commercial
Can You Go Commercial
 
Wordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesWordcamp Edmonton - Slides
Wordcamp Edmonton - Slides
 
Design in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstlDesign in WordPress: Three files, unlimited layouts #wcstl
Design in WordPress: Three files, unlimited layouts #wcstl
 
Gerenciamento de sites/blogs com o WordPress 3.4
Gerenciamento de sites/blogs com o WordPress 3.4Gerenciamento de sites/blogs com o WordPress 3.4
Gerenciamento de sites/blogs com o WordPress 3.4
 

Similaire à Intro to WordPress Plugin Development

A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentR-Cubed Design Forge
 
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 1R-Cubed Design Forge
 
Introduction to WordPress for Beginners
Introduction to WordPress for BeginnersIntroduction to WordPress for Beginners
Introduction to WordPress for BeginnersR-Cubed Design Forge
 
WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and moreR-Cubed Design Forge
 
Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019rickrrr
 
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...R-Cubed Design Forge
 
Introduction to WordPress - WordCamp Ottawa 2019
Introduction to WordPress - WordCamp Ottawa 2019Introduction to WordPress - WordCamp Ottawa 2019
Introduction to WordPress - WordCamp Ottawa 2019R-Cubed Design Forge
 
Backing up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalBacking up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalR-Cubed Design Forge
 
Gutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteGutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteR-Cubed Design Forge
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"LogeekNightUkraine
 
2011 05 word-press-not-just-for-blogging-anymore
2011 05 word-press-not-just-for-blogging-anymore2011 05 word-press-not-just-for-blogging-anymore
2011 05 word-press-not-just-for-blogging-anymoreRudy Duke
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on WindowsShahar Evron
 
Zend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkZend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkRalph Schindler
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionThomas Daly
 
Extending WordPress
Extending WordPressExtending WordPress
Extending WordPressrodasc
 

Similaire à Intro to WordPress Plugin Development (20)

A peek into the world of WordPress plugin development
A peek into the world of WordPress plugin developmentA peek into the world of WordPress plugin development
A peek into the world of WordPress plugin development
 
Multisite for multilingual
Multisite for multilingualMultisite for multilingual
Multisite for multilingual
 
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
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
Introduction to WordPress for Beginners
Introduction to WordPress for BeginnersIntroduction to WordPress for Beginners
Introduction to WordPress for Beginners
 
WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and more
 
Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019Introduction to WordPress, WordCamp Ottawa 2019
Introduction to WordPress, WordCamp Ottawa 2019
 
Backups, Backups, Backups
Backups, Backups, BackupsBackups, Backups, Backups
Backups, Backups, Backups
 
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
Gutenberg 101/Blocks - How to get along with, and even like WordPress's block...
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 
Introduction to WordPress - WordCamp Ottawa 2019
Introduction to WordPress - WordCamp Ottawa 2019Introduction to WordPress - WordCamp Ottawa 2019
Introduction to WordPress - WordCamp Ottawa 2019
 
Backing up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optionalBacking up your WordPress website – it’s not optional
Backing up your WordPress website – it’s not optional
 
Backups, Backups, Backups
Backups, Backups, BackupsBackups, Backups, Backups
Backups, Backups, Backups
 
Gutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress siteGutenberg: Revolutionizing your WordPress site
Gutenberg: Revolutionizing your WordPress site
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
2011 05 word-press-not-just-for-blogging-anymore
2011 05 word-press-not-just-for-blogging-anymore2011 05 word-press-not-just-for-blogging-anymore
2011 05 word-press-not-just-for-blogging-anymore
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on Windows
 
Zend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkZend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend Framework
 
M365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx VersionM365 global developer bootcamp 2019 Intro to SPFx Version
M365 global developer bootcamp 2019 Intro to SPFx Version
 
Extending WordPress
Extending WordPressExtending WordPress
Extending WordPress
 

Dernier

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
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
 
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
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 

Dernier (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
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
 
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
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 

Intro to WordPress Plugin Development

  • 1. “Intro to WordPress Plugin Development” Before we begin please:  Connect to the internet  Grab the slides from:  http://www.slideshare.net/r3df Rick Radko WordCamp Toronto r3df.com September 30th, 2012
  • 2. A little bit about me Rick Radko – R-Cubed Design Forge  Software, web and app designer/developer.  Creating custom web sites since 1996.  Artistic and creative engineer.  Co-organizer of: The Ottawa WordPress Group.  If you have questions or need help, contact me at: wpinfo@r3df.com. Slides are posted at:  http://www.slideshare.net/r3df © 2012 Rick Radko, r3df.com 1
  • 3. About this talk This is a hands on workshop. If you don’t have access to a WordPress site, you can also follow along now and do the workshop later. To work along hands on:  You will need access to your hosting account and a WordPress website. (sites on wordpress.com will not work) Or  A local server, with a WordPress site, on your laptop. No coding experience is required to do this workshop. © 2012 Rick Radko, r3df.com 2
  • 4. Goals In this workshop I will walk run through a reconstruction of a plugin I published on wordpress.org.  With only 45 minutes, the intent is exposure to concepts and ideas, not deep understanding.  There is tons of material on the net to gain deeper understanding at a more leisurely pace. At the end of this presentation you should have:  Some understanding of how my example plugin works.  Some experience to start you down the road of plugin development.  Links and pointers to reference material to take you further down the road. © 2012 Rick Radko, r3df.com 3
  • 5. What is a plugin? Plugins are blocks of code added to WordPress to extend, or change the functionality of:  WordPress  Other plugins  Themes © 2012 Rick Radko, r3df.com 4
  • 6. More about plugins Plugins:  Are written in PHP.  Can be a couple lines of code.  Or 10,000 lines of code.  Make use of WordPress API’s.  Will likely have some HTML and CSS.  May access MySQL.  May use some JavaScript. © 2012 Rick Radko, r3df.com 5
  • 7. Lets create a plugin We could create a “Hello World” widget for our sidebar: But that’s not very useful, or interesting. © 2012 Rick Radko, r3df.com 6
  • 8. Meetup Widget With a few more lines of code we can have: © 2012 Rick Radko, r3df.com 7
  • 9. Tools to use for programming Programming editors:  Code completion  Syntax highlighting  Bracket matching  “Light” and fast  Windows: Notepad++, Sublime Text $$  Mac: TextWrangler, Coda $$, Sublime Text $$ © 2012 Rick Radko, r3df.com 8
  • 10. More tools IDE – Integrated Development Environment  NetBeans, Eclipse, Aptana, PhpStorm $, Komodo $, + more  Cross platform - Java  Do a lot more than a programming editor  Integrated debugging  Profiling  “Heavier” Jeremy Clarke: Code Faster and Smarter PHP with IDE’s Like NetBeans © 2012 Rick Radko, r3df.com 9
  • 11. A place to work Development “Dev” site:  Safe place to work that won’t disturb a live site.  Does not matter if you WSOD the site.  2 Common options:  Sub-domain on your hosted site.  “Local” web server on your pc/laptop.  Requires some set-up – lots of tutorials on net.  No internet connection needed.  Fast, no internet lag, no FTP.  BitNami, XAMPP, Wamp, Mamp. © 2012 Rick Radko, r3df.com 10
  • 12. Not at WordCamp Toronto? If you are doing this workshop on your own, it is recommended that you set-up:  A local server. OR  A site on a sub-domain on your hosting. Lots of resources online, here are a couple for local servers from the codex:  http://codex.wordpress.org/User:Beltranrubo/BitNami  http://codex.wordpress.org/Installing_WordPress_Loc ally_on_Your_Mac_With_MAMP © 2012 Rick Radko, r3df.com 11
  • 13. For the live workshop – we’re taking a shortcut I’m going to demonstrate using the cPanel File Manager and Editor on my hosting account.  If you want to work along:  Please login to your hosting account if you have not already.  Please login to your WordPress admin.  Use any non-critical hosted site you have.  We may cause it to be messed up briefly.  The site cannot be on wordpress.com, you cannot add plugins there. © 2012 Rick Radko, r3df.com 12
  • 14. Available tools This is certainly not the best way to build a plugin, but it is:  The easiest way for us to get going without installing or setting up anything.  Feel free to use a WordPress site on a local server if you have one set-up on your laptop. We also won’t need a programming editor or IDE for the workshop. For the workshop to work, please enter all the text exactly as illustrated. © 2012 Rick Radko, r3df.com 13
  • 15. Log into your hosting account © 2012 Rick Radko, r3df.com 14
  • 16. Open File Manager © 2012 Rick Radko, r3df.com 15
  • 17. File Manager Popup If you see this popup, make sure you have “Web Root” selected and then hit go. © 2012 Rick Radko, r3df.com 16
  • 18. Path to plugins Navigate to the plugin folder. © 2012 Rick Radko, r3df.com 17
  • 19. Create a folder for the plugin © 2012 Rick Radko, r3df.com 18
  • 20. New folder name Folder Name: r3df-meetup-widget © 2012 Rick Radko, r3df.com 19
  • 21. The new folder © 2012 Rick Radko, r3df.com 20
  • 22. Empty plugin folder © 2012 Rick Radko, r3df.com 21
  • 23. Create the main plugin file © 2012 Rick Radko, r3df.com 22
  • 24. The new file form File Name: r3df-meetup-widget.php © 2012 Rick Radko, r3df.com 23
  • 25. The main plugin file © 2012 Rick Radko, r3df.com 24
  • 26. Open the file in the editor © 2012 Rick Radko, r3df.com 25
  • 27. The new and empty file © 2012 Rick Radko, r3df.com 26
  • 28. The file header – the only required part of a plugin <?php /* Plugin Name: R3DF Meetup Widget Description: Displays Meetup group link in a widget Plugin URI: http://r3df.com/ Version: 1.0 WC Demo Author: R3DF Author URI: http://r3df.com/ Author email: wpinfo@r3df.com */ /* Plugin content here */ Creates this plugin information on the Plugins page in the Dashboard © 2012 Rick Radko, r3df.com 27
  • 29. The plugin with header Paste the header code from above, into the file. Plugin header information:  https://codex.wordpress.org/Writing_a_Plugin#File_Headers © 2012 Rick Radko, r3df.com 28
  • 30. Check out the plugin listing in your Dashboard  Ignore the update message if you see one.  Don’t activate it yet! © 2012 Rick Radko, r3df.com 29
  • 31. Empty plugin template We now have an empty plugin that could be used as a template to:  Make your own plugin. (a blank template)  Change the file name, folder name and the header info: name, description, author, etc.  Make a “Site Plugin” to add code to run on your site that is often put into functions.php. See: Don’t: “Just paste this code in your functions.php” or http://ottopress.com/2011/creating-a-site-specific- snippets-plugin/ © 2012 Rick Radko, r3df.com 30
  • 32. Now lets make it do something Copy and paste this code into your plugin replacing /* Plugin content here */: class widget_r3dfmeetup extends WP_Widget { /* constructor */ } add_action('widgets_init', create_function('', 'return register_widget("widget_r3dfmeetup");')); A lot of the code you need to do things in WordPress will start with:  “boilerplate code” – code blocks that are needed and repeatedly reused with slight edits. © 2012 Rick Radko, r3df.com 31
  • 33. The class declaration The line: class widget_r3dfmeetup extends WP_Widget {  Creates a new object that lets us “extend” the WordPress class WP_Widget which does all the heavy lifting in creating a widget. Codex: http://codex.wordpress.org/Widgets_API API – Application Programming Interface  Remote control for WordPress.  Using the API your PHP tells WordPress to do stuff. © 2012 Rick Radko, r3df.com 32
  • 34. Getting into the “action” The line: add_action('widgets_init', create_function('', 'return register_widget( "widget_r3dfmeetup");‘ ));  Tells WordPress to register our widget at the time it is setting up widgets - 'widgets_init'.  You’ll see a line very similar to this for every widget declaration.  To reuse the block of code we just pasted in you only need to change the name and the description. Actions are very important to WordPress plugins. © 2012 Rick Radko, r3df.com 33
  • 35. WordPress actions Actions are one of 2 types of WordPress “Hooks”.  Specific events (100’s) trigger them, for example:  Publishing a post or page  Displaying a post, page or admin page.  Displaying a menu.  Displaying the page content.  http://codex.wordpress.org/Plugin_API/Action_Reference  Your plugin defines a function for WordPress to execute at the time the event occurs.  Generally actions “do” things.  Filters, which we will see later “change” things © 2012 Rick Radko, r3df.com 34
  • 36. Getting hooked on actions WP Native Dashboard Fix  Moving the menu item was accomplished by hooking into the action ‘admin_bar_menu’.  10 lines of code and you have a maintainable fix instead of hacked plugin. © 2012 Rick Radko, r3df.com 35
  • 37. The widget “constructor function” Paste the constructor function into your plugin below the /* constructor */ line: function __construct() { $widget_options = array( 'description' => 'Displays Meetup group link in a widget.', ); $this->WP_Widget(false, $name = 'R3DF: Meetup Group Widget', $widget_options); } /* widget function */  This code is required for a widget.  Sets up the widget with a name and description.  Just change the description and the name to reuse this block of code. © 2012 Rick Radko, r3df.com 36
  • 38. An older style of constructor Some tutorials and/or widgets may have: function <function name that matches class name>() {  This is a older, PHP 4 style for constructors.  The function name needs to match the class defined above. © 2012 Rick Radko, r3df.com 37
  • 39. The widget function Add this code after /* widget function */ line: : function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); if ( !empty($title) ) { echo $before_title . $title . $after_title; } ?> <a href="http://meetup.wptoronto.com/">The Toronto WordPress Group</a> <?php echo $after_widget; } /* form function */  Everything but the red part is required for a widget, to add stuff around your widget content.  The red part you can replace with your content. © 2012 Rick Radko, r3df.com 38
  • 40. Filters “Filters” are the other “hook” type in WordPress. Like actions:  Specific events (100’s) trigger them.  http://codex.wordpress.org/Plugin_API/Filter_Reference  Your plugin defines a function for WordPress to execute at the time of the trigger. Unlike actions:  Filters change things, content passes through a filter function and must be returned, either updated/altered or unchanged. © 2012 Rick Radko, r3df.com 39
  • 41. Filtering the title The apply_filters in our code block: $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);  The filter lets other plugins or code, add functions to change the title content.  It’s important to have this code in the widget.  If a theme were to rely on this filter to affect the way widget titles are shown, the site wouldn’t render correctly without it. © 2012 Rick Radko, r3df.com 40
  • 42. The form function Add this code after /* form function */ line: : $title = esc_attr($instance['title']); ?> function form($instance) { <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php echo 'Title:'; ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> </label></p> <?php } /* update function */  This function creates the widget box you see in your dashboard in admin.  The red part defines the HTML for your entry fields in the form. These can be copied from examples. © 2012 Rick Radko, r3df.com 41
  • 43. The update function Add this code after /* update function */ line: function update($new_instance, $old_instance) { $instance = array(); $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '') ); $instance['title'] = strip_tags($new_instance['title']); return $instance; }  This function saves the option data from the widget box you see in admin.  It also is used to “clean” input that is provided.  strip_tags removes HTML and PHP from the title. © 2012 Rick Radko, r3df.com 42
  • 44. The plugin code © 2012 Rick Radko, r3df.com 43
  • 45. Activate the plugin © 2012 Rick Radko, r3df.com 44
  • 46. Plugin activated © 2012 Rick Radko, r3df.com 45
  • 47. Plugin not activated - error  Debugging can be tricky, the line indicated for the error may be misleading, the error could be one or more lines above.  If you can’t fix this, it’s ok, we’ll update the plugin in a few slides. © 2012 Rick Radko, r3df.com 46
  • 48. Add the widget to the sidebar If your widget loaded, go to Appearance, and then Widgets in your dashboard. © 2012 Rick Radko, r3df.com 47
  • 49. Add a title if you want © 2012 Rick Radko, r3df.com 48
  • 50. The widget on the site You now have a Meetup widget on your site. © 2012 Rick Radko, r3df.com 49
  • 51. We have a widget that works, but… At this point we have a basic widget.  It has all the required elements for a widget.  You could build new widgets by revising the key parts. But, it’s not a great plugin:  You need to edit the code to change the URL or the displayed text.  It’s not very nice looking.  We need to add an image and CSS.  It would not be very good to give to other users. © 2012 Rick Radko, r3df.com 50
  • 52. Pull the baked cake out of the oven Properly adding things like:  options for the URL and text to display.  a Meetup logo.  css loaded in the page header.  internationalization. starts to make things a bit more complicated. So to save time, I’m going to do a cooking show move here, and pull the baked “cake” out of the oven. © 2012 Rick Radko, r3df.com 51
  • 53. Get the final version from wordpress.org Go to your dashboard, Plugins page: © 2012 Rick Radko, r3df.com 52
  • 54. Update successful Once you see “Plugin updated successfully”:  Go to the click on Appearance and then go to the Widgets page. © 2012 Rick Radko, r3df.com 53
  • 55. Update the widget Add the group name and URL in the new option boxes & save. Text: The Toronto WordPress Group URL: http://meetup.wptoronto.com/ © 2012 Rick Radko, r3df.com 54
  • 56. The new widget Once you’ve hit save, take a look at your site:  That’s more like it! © 2012 Rick Radko, r3df.com 55
  • 57. Lets look at some of the new code There are a lot more files and more code.  Some of the files are needed only to put the plugin on wordpress.org.  Sub-folders are added to keep things tidy. © 2012 Rick Radko, r3df.com 56
  • 58. r3df-meetup-widget.php: Header and copyright This is pretty much the same as we started with.  Added the GPL copyright notice © 2012 Rick Radko, r3df.com 57
  • 59. r3df-meetup-widget.php: Class and Constructor We still have the same class statement.  There two new sections in the constructor to load css and set a text domain. © 2012 Rick Radko, r3df.com 58
  • 60. r3df-meetup-widget.php: Widget function The widget function has had the content area changed to allow for CSS styling, to add the image, and the option ‘middle’ for single line display. © 2012 Rick Radko, r3df.com 59
  • 61. r3df-meetup-widget.php: Form function The form function has had blocks added for all of the options. It’s also been internationalized. © 2012 Rick Radko, r3df.com 60
  • 62. r3df-meetup-widget.php: Update function The update function now handles all of the added options.  The wp_parse_args sets defaults and strips out unknown parameters. © 2012 Rick Radko, r3df.com 61
  • 63. r3df-meetup-widget.php: added functions Two new functions have been added  One take care of loading the text domain – needed to use other languages.  The other to put the CSS style sheet in the header. We close with the same add_action we had © 2012 Rick Radko, r3df.com 62
  • 64. uninstall.php This added file runs if the plugin is uninstalled.  It removes the settings that were saved in the database for the widget.  Plugins should clean up after themselves. © 2012 Rick Radko, r3df.com 63
  • 65. The added style sheet Loaded into the page header. © 2012 Rick Radko, r3df.com 64
  • 66. Other possible plugin functions Plugins can have:  activation/deactivation routines  menu items  options pages © 2012 Rick Radko, r3df.com 65
  • 67. What next?  Read some books – next couple of slides.  Watch some WordCamp talks – next couple of slides.  Read the codex:  http://codex.wordpress.org/Writing_a_Plugin  http://codex.wordpress.org/Plugin_Resources  http://codex.wordpress.org/Developer_Documentation © 2012 Rick Radko, r3df.com 66
  • 68. Books - 1 Professional WordPress Plugin Development by: Brad Williams, Ozh Richard, Justin Tadlock Related WordCamp Presentations:  http://www.slideshare.net/williams ba/create-your-first-wordpress- plugin © 2012 Rick Radko, r3df.com 67
  • 69. Books - 2 WordPress Plugin Development Cookbook by: Yannick Lefebvre Related WordCamp videos:  http://wordpress.tv/2011/08/16 /yannick-lefebvre-plugin- development-demystified/  http://wordpress.tv/2012/09/10 /yannick-lefebvre-wordpress- plugin-development-201/ © 2012 Rick Radko, r3df.com 68
  • 70. Books - 3 WordPress 3 Plugin Development Essentials by: Brian Bondari, Everett Griffiths © 2012 Rick Radko, r3df.com 69
  • 71. Contact Rick Radko  email: wpinfo@r3df.com  twitter: @r3designforge Slides at:  www.slideshare.net/r3df © 2012 Rick Radko, r3df.com 70