Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Writing a WordPress Plugin: #heweb12


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
  • Be the first to comment

  • Be the first to like this

Writing a WordPress Plugin: #heweb12

  1. 1. GETTING STARTED• Create a blank PHP file• Add the plugin header -• 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• the plugin class
  3. 3. ADD SOME OPTIONS• Register new admin page•• Create options page• Register/whitelist settings section, settings fields••• Sanitize your settings
  4. 4. MAKE A WIDGET• Another blank PHP file• Open a class that extends WP_Widget• Create the four required functions•
  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 - • Settings API - • Function Reference -• Professional WordPress Plugin Development -• WordPress Plugin Developer Center -• Subversion Utilities • TortoiseSVN (Windows) - • SVNX (MacOS) - • RabbitVCS (Linux) -
  7. 7. QUESTIONS? COMMENTS?Twitter: @cgrymalaWebsite(s): (Multi-Network Setup) (SVN Repo)Email: curtiss@ten-321.comSpeakerRate: