SlideShare una empresa de Scribd logo
1 de 17
Creating Your First
WordPress Plugin
      Colin Loretz
Why?
codex.wordpress.org
        Know it

       Breathe it

        Live it
Anatomy of a Plugin
  Plugin Folder Name
   • main php file
   • js folder
   • css folder
   • php folder
Anatomy of a Plugin
  reno-wordcamp
    • reno-wordcamp.php
    • js
    • css
    • php
Main PHP File
<?php
/*
Plugin Name: Your Plugin Name Here
Plugin URI: Your Plugin URI
Version: Current Plugin Version
Author: You
Description: What does this do?
*/
reno-wordcamp.php
<?php
/*
Plugin Name: Reno WordCamp
Plugin URI: http://renotahoewordcamp.com
Version: v1.0
Author: <a href = “http://colinloretz.com”>Colin Loretz</a>
Description: A plugin for Reno WordCamp
*/
Adding an Action

  function addHeaderCode() {
    echo ʻHello from the clouds!ʼ;
  }
Actions & Filters

 //Actions
 add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1);


?>
Adding a Filter

function addContent($content=ʼʼ) {
  $content .= ʻ<p>Colin is at WordCamp.</p>ʼ;
  return $content;
}
Actions & Filters

 //Actions
 add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1);
 //Filters
 add_filter(ʻthe_contentʼ, ʻaddContentʼ);

?>
Adding a Shortcode


    [renowordcamp]
Adding a Shortcode
  function renoShortcode($att) {
  
  extract(shortcode_atts(array(
  
  
 'foo' => 'no foo',
  
  
 'bar' => 'default bar',
  
  ), $atts));

  
   
   return quot;foo = {$foo}quot;;
  }
Add the Shortcode
 //Actions
 add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1);
 //Filters
 add_filter(ʻthe_contentʼ, ʻaddContentʼ);
 //Shortcodes
 add_shortcode('renowordcamp', 'renoShortcode');
Going Further

Saving & Storing   Explore Plugins
                     Learn from others
  Options

  Post Metadata

  Database
Want More?

• Wordpress.org (and codex)
• WP-Hacker email list (google it)
• WordPress Planet
Find Me

   @colinloretz


www.colinloretz.com

Más contenido relacionado

La actualidad más candente

Web Audio API + AngularJS
Web Audio API + AngularJSWeb Audio API + AngularJS
Web Audio API + AngularJSChris Bateman
 
Five events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowFive events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowCaldera Labs
 
Scratching the surface of hunky-dory Elixir features
Scratching the surface of hunky-dory Elixir featuresScratching the surface of hunky-dory Elixir features
Scratching the surface of hunky-dory Elixir featuresAdam Hodowany
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
PowerShell: Automation for everyone
PowerShell: Automation for everyonePowerShell: Automation for everyone
PowerShell: Automation for everyoneGavin Barron
 
Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"Fwdays
 
Build a bot workshop async primer - php[tek]
Build a bot workshop  async primer - php[tek]Build a bot workshop  async primer - php[tek]
Build a bot workshop async primer - php[tek]Adam Englander
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方techmemo
 
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.Workhorse Computing
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application frameworktechmemo
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium Workhorse Computing
 
IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009Yusuke Wada
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 

La actualidad más candente (20)

Web Audio API + AngularJS
Web Audio API + AngularJSWeb Audio API + AngularJS
Web Audio API + AngularJS
 
Five events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowFive events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should know
 
Modern Perl Toolchain
Modern Perl ToolchainModern Perl Toolchain
Modern Perl Toolchain
 
nginx mod PSGI
nginx mod PSGInginx mod PSGI
nginx mod PSGI
 
Scratching the surface of hunky-dory Elixir features
Scratching the surface of hunky-dory Elixir featuresScratching the surface of hunky-dory Elixir features
Scratching the surface of hunky-dory Elixir features
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
PowerShell: Automation for everyone
PowerShell: Automation for everyonePowerShell: Automation for everyone
PowerShell: Automation for everyone
 
Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"
 
Build a bot workshop async primer - php[tek]
Build a bot workshop  async primer - php[tek]Build a bot workshop  async primer - php[tek]
Build a bot workshop async primer - php[tek]
 
優しいWAFの作り方
優しいWAFの作り方優しいWAFの作り方
優しいWAFの作り方
 
Selenium sandwich-2
Selenium sandwich-2Selenium sandwich-2
Selenium sandwich-2
 
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
 
Mojo as a_client
Mojo as a_clientMojo as a_client
Mojo as a_client
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
Web Scraping
Web ScrapingWeb Scraping
Web Scraping
 
Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium
 
IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 

Similar a Creating Your First WordPress Plugin Guide</h1

The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page CreationWildan Maulana
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPressNick La
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterStraight North
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsPete DuMelle
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCPPete DuMelle
 
WordPress Plugin development
WordPress Plugin developmentWordPress Plugin development
WordPress Plugin developmentMostafa Soufi
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress PluginAndy Stratton
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastMichelangelo van Dam
 

Similar a Creating Your First WordPress Plugin Guide</h1 (20)

Actions filters
Actions filtersActions filters
Actions filters
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPress
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle Twitter
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / Widgets
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCP
 
WordPress Plugin development
WordPress Plugin developmentWordPress Plugin development
WordPress Plugin development
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Web Scraping with PHP
Web Scraping with PHPWeb Scraping with PHP
Web Scraping with PHP
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
Php
PhpPhp
Php
 
09 Oo Php Register
09 Oo Php Register09 Oo Php Register
09 Oo Php Register
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

Más de Colin Loretz

Controlling Robots with Javascript, Ruby and Go
Controlling Robots with Javascript, Ruby and GoControlling Robots with Javascript, Ruby and Go
Controlling Robots with Javascript, Ruby and GoColin Loretz
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSSColin Loretz
 
Making Things Happen
Making Things HappenMaking Things Happen
Making Things HappenColin Loretz
 
Building App Themes for WordPress
Building App Themes for WordPressBuilding App Themes for WordPress
Building App Themes for WordPressColin Loretz
 
Steps to Open the Reno Makerspace
Steps to Open the Reno Makerspace Steps to Open the Reno Makerspace
Steps to Open the Reno Makerspace Colin Loretz
 
Reno Collective Coworking
Reno Collective CoworkingReno Collective Coworking
Reno Collective CoworkingColin Loretz
 
WordCamp Las Vegas: Your App is in my WordPress
WordCamp Las Vegas: Your App is in my WordPressWordCamp Las Vegas: Your App is in my WordPress
WordCamp Las Vegas: Your App is in my WordPressColin Loretz
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMSColin Loretz
 
50 Apps to Fuel Your Online Business
50 Apps to Fuel Your Online Business50 Apps to Fuel Your Online Business
50 Apps to Fuel Your Online BusinessColin Loretz
 
Ignite Reno: Diagnosing Technology as a Mental Disorder
Ignite Reno: Diagnosing Technology as a Mental DisorderIgnite Reno: Diagnosing Technology as a Mental Disorder
Ignite Reno: Diagnosing Technology as a Mental DisorderColin Loretz
 
Adobe Flex: Creating Widgets for the Desktop and Web
Adobe Flex: Creating Widgets for the Desktop and WebAdobe Flex: Creating Widgets for the Desktop and Web
Adobe Flex: Creating Widgets for the Desktop and WebColin Loretz
 
Share an internet connection through WiFi [Mac OS X[
Share an internet connection through WiFi [Mac OS X[Share an internet connection through WiFi [Mac OS X[
Share an internet connection through WiFi [Mac OS X[Colin Loretz
 

Más de Colin Loretz (14)

HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Controlling Robots with Javascript, Ruby and Go
Controlling Robots with Javascript, Ruby and GoControlling Robots with Javascript, Ruby and Go
Controlling Robots with Javascript, Ruby and Go
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
 
Making Things Happen
Making Things HappenMaking Things Happen
Making Things Happen
 
Building App Themes for WordPress
Building App Themes for WordPressBuilding App Themes for WordPress
Building App Themes for WordPress
 
Zen of WordPress
Zen of WordPressZen of WordPress
Zen of WordPress
 
Steps to Open the Reno Makerspace
Steps to Open the Reno Makerspace Steps to Open the Reno Makerspace
Steps to Open the Reno Makerspace
 
Reno Collective Coworking
Reno Collective CoworkingReno Collective Coworking
Reno Collective Coworking
 
WordCamp Las Vegas: Your App is in my WordPress
WordCamp Las Vegas: Your App is in my WordPressWordCamp Las Vegas: Your App is in my WordPress
WordCamp Las Vegas: Your App is in my WordPress
 
WordPress as a CMS
WordPress as a CMSWordPress as a CMS
WordPress as a CMS
 
50 Apps to Fuel Your Online Business
50 Apps to Fuel Your Online Business50 Apps to Fuel Your Online Business
50 Apps to Fuel Your Online Business
 
Ignite Reno: Diagnosing Technology as a Mental Disorder
Ignite Reno: Diagnosing Technology as a Mental DisorderIgnite Reno: Diagnosing Technology as a Mental Disorder
Ignite Reno: Diagnosing Technology as a Mental Disorder
 
Adobe Flex: Creating Widgets for the Desktop and Web
Adobe Flex: Creating Widgets for the Desktop and WebAdobe Flex: Creating Widgets for the Desktop and Web
Adobe Flex: Creating Widgets for the Desktop and Web
 
Share an internet connection through WiFi [Mac OS X[
Share an internet connection through WiFi [Mac OS X[Share an internet connection through WiFi [Mac OS X[
Share an internet connection through WiFi [Mac OS X[
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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...Miguel Araújo
 
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 AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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...Martijn de Jong
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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 Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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...Neo4j
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Creating Your First WordPress Plugin Guide</h1

  • 1. Creating Your First WordPress Plugin Colin Loretz
  • 3. codex.wordpress.org Know it Breathe it Live it
  • 4. Anatomy of a Plugin Plugin Folder Name • main php file • js folder • css folder • php folder
  • 5. Anatomy of a Plugin reno-wordcamp • reno-wordcamp.php • js • css • php
  • 6. Main PHP File <?php /* Plugin Name: Your Plugin Name Here Plugin URI: Your Plugin URI Version: Current Plugin Version Author: You Description: What does this do? */
  • 7. reno-wordcamp.php <?php /* Plugin Name: Reno WordCamp Plugin URI: http://renotahoewordcamp.com Version: v1.0 Author: <a href = “http://colinloretz.com”>Colin Loretz</a> Description: A plugin for Reno WordCamp */
  • 8. Adding an Action function addHeaderCode() { echo ʻHello from the clouds!ʼ; }
  • 9. Actions & Filters //Actions add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1); ?>
  • 10. Adding a Filter function addContent($content=ʼʼ) { $content .= ʻ<p>Colin is at WordCamp.</p>ʼ; return $content; }
  • 11. Actions & Filters //Actions add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1); //Filters add_filter(ʻthe_contentʼ, ʻaddContentʼ); ?>
  • 12. Adding a Shortcode [renowordcamp]
  • 13. Adding a Shortcode function renoShortcode($att) { extract(shortcode_atts(array( 'foo' => 'no foo', 'bar' => 'default bar', ), $atts)); return quot;foo = {$foo}quot;; }
  • 14. Add the Shortcode //Actions add_action(ʻwp_headʼ, ʻaddHeaderCodeʼ, 1); //Filters add_filter(ʻthe_contentʼ, ʻaddContentʼ); //Shortcodes add_shortcode('renowordcamp', 'renoShortcode');
  • 15. Going Further Saving & Storing Explore Plugins Learn from others Options Post Metadata Database
  • 16. Want More? • Wordpress.org (and codex) • WP-Hacker email list (google it) • WordPress Planet
  • 17. Find Me @colinloretz www.colinloretz.com

Notas del editor