Your SlideShare is downloading. ×
Writing a WordPress Plugin: #heweb12
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Writing a WordPress Plugin: #heweb12

632
views

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 …

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
632
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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. 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. 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. 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. 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. 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. 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