SlideShare a Scribd company logo
1 of 40
WordPress Plugin Development Presented By Thirupathi.J
Concepts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is WordPress? WordPress is an open source blog publishing application powered by PHP and MySQL which can also be used for content management. It has many features including a workflow, a plugin architecture and a templating system.
How to install WordPress? Download the wordpress latest version from: http://wordpress.org/download/
What is a WordPress plugin? Little applications used to enhance functionality or add specific functions tailored to a site's specific needs.
Some plugins: Capitalize Titles of Pages and Posts WordPress Database Backup WordPress.com Stats Comment Hilite
What do you need to make a plugin? a problem to solve some PHP knowledge  some spare time a test server with your test wordpress (XAMPP is good.) ‏
Plugin Directory Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://codex.wordpress.org/Writing_a_Plugin#Names.2C_Files.2C_and_Locations
Plugin API - Enabled "hooks" - Extend functionality without editing the core code - Two categories: Actions and Filters
2 Kinds of WordPress Hooks Actions = “Do Something” Filters = “Transform”
Actions Actions are the hooks that the WordPress  core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more  of its PHP functions are executed at these  points, using the Action API. add_action( 'hook_name', 'your_function_name', [priority], [accepted_args] );
Filters Functions that modify text, lists and various types of information that are used and produced by WordPress. add_filter('hook_name', 'your_filter_function', [priority], [accepted_args]);
Writing Your First Plugin
readme.txt ,[object Object],[object Object],Useful only for publishing to WordPress Plugin Directory Information about your plugin: Description, Installation, Changelog, Donation Links, Tags, etc...
screenshot-1.png ,[object Object],[object Object]
my-plugin.php ,[object Object],[object Object],[object Object],[object Object],[object Object]
File Structure
Plugin Headers http://codex.wordpress.org/Writing_a_Plugin#Standard_Plugin_Information
Plugin Headers http://codex.wordpress.org/Writing_a_Plugin#Standard_Plugin_Information ,[object Object],[object Object]
Hooks (Filters)
Hooks (Filters) ,[object Object],[object Object]
PHP Code
Plugin 1 Figure out what you want to do. I want to convert all instances of  “WordPress” to “WORDPRESS”in a post's content.
the_content  (filter) http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content
add_filter http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content
add_filter http://codex.wordpress.org/Plugin_API#Hook_to_WordPress ② ①   Hook Name ②  Callback ①
Hook Callback ,[object Object],[object Object],[object Object],[object Object]
Hook Callback ,[object Object],[object Object],[object Object],[object Object]
They do the same thing
I Prefer Array Callbacks ,[object Object],[object Object],[object Object]
Filters are Transformations filters have to return a transformation
Filter  return  Values ,[object Object],② ①   return ②  transformation ① http://php.net/manual/en/function.preg-replace.php
 
Plugin 2 Figure out what you want to do. I want to  BOLD all instances of “WORDPRESS” in a post's content.
Hook Priority http://codex.wordpress.org/Plugin_API#Hook_to_WordPress
Priority ② ②  Callback ① ③ ② ② ③   Priority  (optional) ①   Hook Name http://codex.wordpress.org/Plugin_API#Hook_to_WordPress
Which one goes first? WordPress2WORDPRESS#the_content ABolderWordPress#the_content
Default Priority 10 smaller numbers = higher priority larger numbers = lower priority http://codex.wordpress.org/Plugin_API#Hook_to_WordPress
Therefore Order of execution: (10)   WordPress2WORDPRESS#the_content (20)   ABolderWordPress#the_content
THANK YOU

More Related Content

More from Nyros Technologies

More from Nyros Technologies (20)

MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
 
Web Designing Bugs - Fixes By Nyros Developer
Web Designing Bugs - Fixes By Nyros DeveloperWeb Designing Bugs - Fixes By Nyros Developer
Web Designing Bugs - Fixes By Nyros Developer
 
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros DeveloperCapistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros Developer
 
Web 2.0 Design Standards By Nyros Developer
Web 2.0 Design Standards By Nyros DeveloperWeb 2.0 Design Standards By Nyros Developer
Web 2.0 Design Standards By Nyros Developer
 
Web 2.0 By Nyros Developer
Web 2.0 By Nyros DeveloperWeb 2.0 By Nyros Developer
Web 2.0 By Nyros Developer
 
Caching By Nyros Developer
Caching By Nyros DeveloperCaching By Nyros Developer
Caching By Nyros Developer
 
Language Integrated Query By Nyros Developer
Language Integrated Query By Nyros DeveloperLanguage Integrated Query By Nyros Developer
Language Integrated Query By Nyros Developer
 
New Features in .Net Framework 4.0 By Nyros Developer
New Features in .Net Framework 4.0 By Nyros DeveloperNew Features in .Net Framework 4.0 By Nyros Developer
New Features in .Net Framework 4.0 By Nyros Developer
 
Oops in PHP By Nyros Developer
Oops in PHP By Nyros DeveloperOops in PHP By Nyros Developer
Oops in PHP By Nyros Developer
 
Connect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros DeveloperConnect with Facebook to Rails Application By Nyros Developer
Connect with Facebook to Rails Application By Nyros Developer
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Research on Audio and Video Streaming
Research on Audio and Video StreamingResearch on Audio and Video Streaming
Research on Audio and Video Streaming
 
User Interface
User InterfaceUser Interface
User Interface
 
Audio and Video Streaming
Audio and Video StreamingAudio and Video Streaming
Audio and Video Streaming
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
Social Networking
Social NetworkingSocial Networking
Social Networking
 
Payment Gateway
Payment GatewayPayment Gateway
Payment Gateway
 
Aws
AwsAws
Aws
 

Word Press Plugin Development By Nyros Developer