CONTENTS
Professional WordPress Plugin Development
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2011 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-91622-3
ISBN: 978-1-118-07530-2 (ebk)
ISBN: 978-1-118-07532-6 (ebk)
ISBN: 978-1-118-07531-9 (ebk)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions .
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Library of Congress Control Number: 2011920897
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. WordPress is a registered trademark of Automattic, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
To my Father, Robert Basket Bob Williams, for inspiring me to become the man I am today.
Brad Williams
To my wife Ariane for her support while I was escaping household chores, and to my kids Oscar and Cyrus wholl be WordPress hackers in 10 years.
Ozh Richard
To my family for allowing me to explore the online world as a career path and the WordPress community for inviting me in.
Justin Tadlock
CREDITS
Executive Editor
Carol Long
Project Editor
Kelly Talbot
Technical Editors
Doug Vann
Andrew Nacin
Production Editor
Rebecca Anderson
Copy Editor
Apostrophe Editing Services
Editorial Director
Robyn B. Siesky
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Associate Publisher
Jim Minatel
Project Coordinator, Cover
Katie Crocker
Proofreader
Jen Larsen, Word One New York
Indexer
Johnna VanHoose Dinse
Cover Designer
Michael E. Trent
Cover Photo
pagadesign/istockphoto.com
ABOUT THE AUTHORS
BRAD WILLIAMS is the CEO and co-founder of WebDevStudios.com . He is also a co-host on the SitePoint podcast and the co-author of Professional WordPress . Brad has been developing websites for more than 14 years, including the last 4 where he has focused on open-source technologies like WordPress. Brad has given presentations at various WordCamps across the country, is the organizer for the New Jersey and Philadelphia WordPress Meetups and WordCamp Philly. In 2010 Brad founded Pluginize.com , a company dedicated to building custom WordPress plugins.
OZH RICHARD is a web developer who started to use WordPress at version 1.0.1, published his first WordPress-powered website in May 2004, and released his first plugin three months later. He has since developed several popular plugins, won an Annual WordPress Plugin Competition, and is now an official judge. When not coding WordPress plugins or sharing tutorials, Ozh contributes to other Open Source projects such as YOURLS, a self-hosted URL shortener, or plays Quake . You can find Ozh online at http://ozh.org/ .
JUSTIN TADLOCK is a Web developer and designer who coded his first Web page in 2003 at the age of 18, only months after getting his first computer. He found WordPress in 2005 and has been working with and contributing to the platform ever since. He has developed many popular WordPress plugins and themes while exploring several business paths using the open-source platform.
ACKNOWLEDGMENTS
THANK YOU to the love of my life, April, for your endless support, friendship, and continuing to put up with my nerdy ways. Thank you to my awesome nieces, Indiana Brooke and Austin Margaret. Thank you Carol Long for believing in this book idea and helping make it a reality. To Ozh and Justin, two amazing co-authors, your knowledge of WordPress is unmatched, and this book wouldnt have been what it is without you both. Thank you to the entire WordPress community for your support, friendships, motivation, and guidance. Thank you fizzypop for making WordCamp after parties the stuff of legend. Last but not least thank you to my ridiculous zoo: Lecter, Clarice, and Squeaks the Cat (aka Kitty Galore). Your smiling faces and wiggly butts always put a smile on my face.
Brad Williams
ITS BEEN A LONG TIME in the WordPress community since I first started to dissect the few plugins that began to pop like daisies in 2004 and tried to understand how things worked. To all the coders who released the code that taught me the innards of WordPress, I cant express how much I owe you. To all the members of the WordPress community who dont write code but foster the creativity and water our community, thank you for your invaluable dedication. To Brad, who sent me that crazy proposal about a plugin book, I hope Ill cross the oceans one day to have a few beers with you. To Ronnie James Dio, Tom Araya, Bruce Dickinson, Blaze Bayley, Lemmy Kilmister, Dave Mustaine, Rob Zombie, Till Lindemann, and Mike Muir, whose gentle voices have lulled me and inspired me while I was writing late at night.