Chapter 8

Plugin Development


  • Creating plugin files
  • Data validation and plugin security
  • Using WordPress filter and action hooks
  • How to properly use the Settings API
  • Creating a widget and dashboard widget
  • Creating custom shortcodes
  • Supporting language translation
  • Publishing a plugin to the official Plugin Directory


The code downloads for this chapter are found at on the Download Code tab. The code is in the Chapter 8 download file and individually named according to the code file names throughout the chapter.

One of the main reasons WordPress is such a popular software platform is the ease with which it can be extended. Plugins are the primary reason for this and allow endless possibilities in extending WordPress. This chapter discusses everything you need to know to create amazing plugins in WordPress.

You are going to look at plugins from both a functional and structural perspective. Starting with the packaging of plugin files, you’ll dig into the API hooks that connect your custom plugin code to the WordPress core and show how to integrate a plugin into various parts of the WordPress editing, management, and display processes. Finally, you will see how to publish a plugin for others to use. At the end of this chapter, you build a WordPress plugin from the ground up. You’ll utilize many of the features discussed in this chapter and learn the proper way to extend ...

Get Professional WordPress: Design and Development, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.