Write Your First WordPress Plugin
Upcoming SlideShare
Loading in...5
×
 

Write Your First WordPress Plugin

on

  • 8,289 views

A session by Eng.Ibrahim Abdel Fattah Mohamed in WordCamp Egypt 2009, discussing how you can start with coding your own WordPress Plugins.

A session by Eng.Ibrahim Abdel Fattah Mohamed in WordCamp Egypt 2009, discussing how you can start with coding your own WordPress Plugins.

Statistics

Views

Total Views
8,289
Views on SlideShare
8,216
Embed Views
73

Actions

Likes
5
Downloads
95
Comments
1

7 Embeds 73

http://br.bingorabbit.com 24
http://www.slideshare.net 19
http://event.wordcampegypt.com 12
http://indyroma.c4occupata.org 12
http://www.linkedin.com 3
http://2009.wordcampegypt.com 2
http://webcache.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Write Your First WordPress Plugin Write Your First WordPress Plugin Presentation Transcript

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