Book Image

WordPress Plugin Development: Beginner's Guide

Book Image

WordPress Plugin Development: Beginner's Guide

Overview of this book

If you can write WordPress plug-ins, you can make WordPress do just about anything. From making the site easier to administer, to adding the odd tweak or new feature, to completely changing the way your blog works, plug-ins are the method WordPress offers to customize and extend its functionality. This book will show you how to build all sorts of WordPress plug-ins: admin plug-ins, Widgets, plug-ins that alter your post output, present custom "views" of your blog, and more. WordPress Plug-in Development (Beginner's Guide) focuses on teaching you all aspects of modern WordPress development. The book uses real and published WordPress plug-ins and follows their creation from the idea to the finishing touches, in a series of carefully picked, easy-to-follow tutorials. You will discover how to use the WordPress API in all typical situations, from displaying output on the site in the beginning to turning WordPress into a CMS in the last chapter. In Chapters 2 to 7 you will develop six concrete plug-ins and conquer all aspects of WordPress development. Each new chapter and each new plug-in introduces different features of WordPress and how to put them to good use, allowing you to gradually advance your knowledge. This book is written as a guide to take your WordPress skills from the very beginning to the level where you are able to completely understand how WordPress works and how you can use it to your advantage.
Table of Contents (14 chapters)
WordPress Plugin Development
Credits
About the Author
About the Reviewer
Preface
Index

Final notes


Before we start with development, let's have a quick reminder on how to install and manage WordPress plugins. Also I'll mention a handy tip for quickly accessing code examples.

Installing and managing plugins

When you want to install a plugin, you need to follow these simple steps:

  1. Upload the plugin folder (for example wp-wall) to your server's wp-content/plugins/ folder.

  2. Go to your WordPress administration section, and select Plugins from the menu. This will give you a list of all the installed plugins. Scroll down the list until you find yours, and click Activate.

    If you intend to manually update the plugin files on a live site, it is advisable to deactivate the plugin first using the Plugins menu.

    Strictly speaking, on a development blog where you are the only user, this can be skipped to save time.

    Note

    If something goes wrong with the plugin, and you are unable to access your WordPress site anymore, deleting the plugin folder from the server will deactivate the plugin automatically, and will instantly get your site working again.

If you need more information regarding plugin management, you can refer to the latest WordPress manual found at http://codex.wordpress.org/Managing_Plugins.

Searching documentation

During the plugin development, you will more or less need to refer to documentation.

Luckily, you will have this book on your hand either in paper or in a PDF form, so you can take a quick look. Then, you also have the WordPress online documentation found at http://codex.wordpress.org/Main_Page.

Due to the rapid speed at which WordPress has been developing, not all the functions have been documented.

So, I keep a copy of the latest version of WordPress locally. This way, I am able to find the reference to the function in the WordPress core quickly, and figure out how it is used.

I also tend to keep a local copy of the entire plugin repository on my computer (you can find more details on how to do that in Chapter 8) so that I can search through the entire plugin repository and find instances of this function used by other plugin authors (and you can always find new and creative uses as well).

Using other plugins for this purpose can really save a lot of time, and it is often the easiest way to learn how to perform certain functionalities.