WordPress Bible, 2nd Edition
Aaron Brazell
WordPress Bible, 2nd Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2011 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-93781-5
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
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 Website 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 Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites 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 or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002.
Library of Congress Control Number: 2011924123
Trademarks: Wiley, the Wiley logo, 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.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
About the Author
Aaron Brazell is a Co-Founder at WP Engine, an Austin, Texas-based startup built to meet the technical needs of WordPress bloggers. He is a WordPress core contributor and has been an active member of the WordPress community since 2004 as a developer, user, and consultant.
He is a frequent public speaker, engaging with the WordPress community at WordCamps around the United States, as well as at marketing, social media, and other industry events. He has organized WordCamp Mid-Atlantic, a WordPress community conference catering to the Greater Capital region, which includes Maryland, D.C., Delaware, and Northern Virginia. He believes in challenging conventional thinking and assumptions, and as a result, often takes actions that are provocative, strategic, and unconventional in an effort to move dialogue and popular opinion forward.
In addition to his work with WordPress and social media, Aaron is an avid photographer and sports fan (his favorite teams are the Boston Red Sox and Baltimore Ravens), and has one son, Devin Michael. He currently lives in Austin, Texas.
Dedication
To Devin, my only son, for giving me something to think about even when I don't realize I need to be thinking about it.
Credits
Senior Acquisitions Editor
Stephanie McComb
Executive Editor
Jody Lefevere
Project Editor
Beth Taylor
Technical Editor
Mark Jaquith
Copy Editor
Beth Taylor
Editorial Director
Robyn Siesky
Editorial Manager
Rosemarie Graham
Business Manager
Amy Knies
Senior Marketing Manager
Sandy Smith
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Project Coordinator
Sheree Montgomery
Graphics and Production Specialists
Melanee Habig Ronald G. Terry
Quality Control Technician
Melissa Cossell
Proofreading
Evelyn Wellborn
Indexing
BIM Indexing & Proofreading Services
Media Development Project Manager
Laura Moss
Media Development Assistant Project Manager
Jenny Swisher
Media Development Associate Producers
Josh Frank
Shawn Patrick
Doug Kuhn
Marilyn Hummel
Foreword
When Aaron first mentioned he was writing the WordPress Bible , I immediately offered him a hand in editing. I figured it was a safe bet. After all, I'm a PHP guy with five years of Drupal experience and zero years of WordPress. In fact, my only involvement with WordPress was attending WordCamp Mid-Atlantic; I'd never even installed it before. I had to open my mouth....
Fast-forward a couple months and suddenly chapter after chapter fill my inbox. So I started digging into this alien environment from two different perspectives: first, from the community perspective and second, from a developer's perspective.
For open source projects, the community is important to understand. Not only do you need to know how to get involved, but also you also need to know how healthy it is. Is this project going to be active a month or year from now? Therefore, I started reading with the intent to learn about the WordPress community. I wanted to know its motivations, how it interacted, how decisions were made, and how information flows within, into, and out of the team. Delving into the community and help chapters, I learned quite a bit. I found myself dropping into IRC, exploring a mailing list or two, and hitting WordPress forums to see how new voices were welcomed. To be honest, I appreciated the perspective and guidance from someone who gets it.
Secondly, one of the joys of open source is looking at things from a developer's perspective. Unfortunately, many open source projects are a pile of messy code with horrible documentation, and you'll find yourself huddled under a desk crying pitifully in under 15 minutes. With WordPress, I didn't have that experience. Sure, there were times when something didn't make sense at first pass, but I kept digging. I asked some harsh questions related to PHP 5 and object-oriented principles and coding standards and APIs and a variety of other things. Each response even those which I disagreed with was well-reasoned and internally consistent. More important, the documentation and explanations supporting the system were amazing and provided numerous great examples. In fact, the underlying concepts were useful enough that I've duplicated a few in one of my projects.