PacktLib: WordPress 3 Plugin Development Essentials

WordPress 3 Plugin Development Essentials

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Preparing for WordPress Development

WordPress background

Extending WordPress

Understanding WordPress architecture

Summarizing architecture

Tools for web development

Coding best practices

Basic organization

Planning ahead / starting development

Debugging

Summary

Anatomy of a Plugin

Deconstructing an existing plugin: "Hello Dolly"

Information header

Understanding the Includes

Bonus for the curious

User-defined functions

Referencing hooks via add_action() and add_filter()

Actions versus Filters

Summary

Social Bookmarking

The overall plan

Proof of concept

The master plugin outline

Checking WordPress versions

Summary

Ajax Search

What is Ajax?

The overall plan

The proof of concept mock up

Creating our plugin

Summary

Content Rotator

The plan

Widget overview

Preparation

Add custom text

Adding widget options

Generating random content

Expiration dates: adding options to our widget

Adding a custom manager page

Randomizing content from the database

Review of PHP functions used

Summary

Standardized Custom Content

What WordPress does for you: custom fields

What WordPress doesn't do for you

Standardizing a post's custom fields

Creating a new plugin

Having trouble saving data?

Displaying custom data in your Templates

Known limitations

Summary

Custom Post Types

Background: What's in a name?

Understanding register_post_type()

Customizing our post type

Customizing our plugin

Creating a settings shortcut link

Cleaning up when uninstalling

Summary

Versioning Your Code with Subversion (SVN)

Why Subversion?

Setting up an SVN repository

Checking out a local working copy of our repo

Adding files

Committing changes to the repository

Overcoming errors

Moving files

Exporting your working copy

Quick reference

Summary

Preparing Your Plugin for Distribution

Public enemy number one: PHP notices

PHP short tags

Conflicting names

Modifying loader.php

Testing WordPress version

Testing PHP version

Testing MySQL version

Testing PHP modules

Testing WordPress installed plugins

Custom tests

Unit tests

WordPress limitations

Health check page

Storing test results in the database

Death to clippy: Use sensible configurations

Double check your interface

Documentation

The decalog of documentation

Summary

Publishing Your Plugin

Internationalization and localization

Processing each message

Best practices

Working with formatting

More advanced messages

Plural vs. singular

More complex messages

Language files

Creating a POT file

Creating translations: .po files

Loading a textdomain

Updating a translation

Format for the readme.txt file

Requesting and using SVN access

Publicity and promotion

Summary

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

Recommended Resources

WordPress API Reference

WordPress API Reference

WordPress API Reference

WordPress API Reference

WordPress API Reference

Index