GETTING STARTED• Create a blank PHP file• Add the plugin header - http://j.mp/TgCGXP• Plan your plugin• What should it do?...
CREATE A SHORTCODE•   Implement a new shortcode•   Implement the base functionality• Register the new shortcode• http://co...
ADD SOME OPTIONS• Register new admin page• http://codex.wordpress.org/Function_Reference/add_submenu_page•   Create option...
MAKE A WIDGET•   Another blank PHP file•   Open a class that extends WP_Widget• Create the four required functions• http:/...
OTHER RESOURCES/FUNCTIONS•   plugins_url – automatically build the URL to a specific file•   plugin_dir_path – automatical...
RESOURCES• The WordPress Codex   • Plugin API - http://codex.wordpress.org/Plugin_API/   • Settings API - http://codex.wor...
QUESTIONS? COMMENTS?Twitter:    @cgrymalaWebsite(s): http://umw.edu/ (Multi-Network Setup)            http://ten-321.com/ ...
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12
Upcoming SlideShare
Loading in...5
×

Writing a WordPress Plugin: #heweb12

698

Published on

During this workshop, we will write a simple WordPress plugin. I will take you through the basic steps of creating the plugin file, including the proper header, and using some basic API functions available in WordPress. As part of the plugin, we'll develop a new shortcode to be used anywhere within the content of posts and we'll develop a widget to be used in widgetized areas (such as sidebars and footers). We will also review the process of creating the "settings" area for the plugin to be displayed in the administration area of WordPress.

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
698
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Writing a WordPress Plugin: #heweb12

  1. 1. GETTING STARTED• Create a blank PHP file• Add the plugin header - http://j.mp/TgCGXP• Plan your plugin• What should it do?• What features/options should it have?• Create another blank PHP file• Open and close a new PHP class
  2. 2. CREATE A SHORTCODE• Implement a new shortcode• Implement the base functionality• Register the new shortcode• http://codex.wordpress.org/Function_Reference/add_shortcodeInstantiate the plugin class
  3. 3. ADD SOME OPTIONS• Register new admin page• http://codex.wordpress.org/Function_Reference/add_submenu_page• Create options page• Register/whitelist settings section, settings fields• http://codex.wordpress.org/Function_Reference/add_settings_section• http://codex.wordpress.org/Function_Reference/add_settings_field• Sanitize your settings
  4. 4. MAKE A WIDGET• Another blank PHP file• Open a class that extends WP_Widget• Create the four required functions• http://codex.wordpress.org/Widgets_API#Developing_Widgets
  5. 5. OTHER RESOURCES/FUNCTIONS• plugins_url – automatically build the URL to a specific file• plugin_dir_path – automatically retrieve absolute path to directory• WPDB Class – access and manipulate the WordPress database• WP_HTTP Class – retrieve Web resources without depending on cURL• Transients API – store cache information with explicit expiration times
  6. 6. RESOURCES• The WordPress Codex • Plugin API - http://codex.wordpress.org/Plugin_API/ • Settings API - http://codex.wordpress.org/Settings_API • Function Reference - http://codex.wordpress.org/Function_Reference• Professional WordPress Plugin Development - http://j.mp/MxjUfG• WordPress Plugin Developer Center - http://j.mp/MxkDNR• Subversion Utilities • TortoiseSVN (Windows) - http://tortoisesvn.net/ • SVNX (MacOS) - http://code.google.com/p/svnx/ • RabbitVCS (Linux) - http://rabbitvcs.org/
  7. 7. QUESTIONS? COMMENTS?Twitter: @cgrymalaWebsite(s): http://umw.edu/ (Multi-Network Setup) http://ten-321.com/ http://svn.ten-321.com/ (SVN Repo)Email: cgrymala@umw.edu curtiss@ten-321.comSpeakerRate: http://spkr8.com/s/10608 http://about.me/cgrymala
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×