Book Image

WordPress Plugin Development Cookbook

By : Yannick Lefebvre
Book Image

WordPress Plugin Development Cookbook

By: Yannick Lefebvre

Overview of this book

<p>WordPress is a popular, powerful, and open Content Management System. Learning to extend its core capabilities allows you to unleash its full potential, whether you're an administrator who cannot find the right extension, or a developer with a great idea to enhance the platform for the community, or a website designer/developer working to fulfill a client's needs. "WordPress Plugin Development Cookbook" is the perfect companion for plugin developers, offering easy-to-follow instructions to accomplish tasks that range from basic plugin creation and configuration to advanced customization techniques. Each topic is illustrated through realistic examples showing how it can be applied to solve common problems, followed by explanations of all concepts used. Create WordPress plugins of varying complexity, from a few lines that change a specific function to complex extensions that provide intricate new capabilities. From the creation of your first simple plugin to adding entire new sections and widgets in the administration interface, learn how to change and extend WordPress to perform virtually any task. After installing and configuring an efficient plugin development environment, you will discover how to register your own callbacks that WordPress will execute at key points, forming the basis of plugin creation. Armed with this essential knowledge, you'll explore how to create administration pages to allow users to configure your new creations and to add new content management sections to WordPress through custom post types and custom database tables. Once you have all these elements in place, improve your plugins by customizing the post and page editors, creating user-facing forms to populate new content sections, making your plugin output dynamic using Javascript and AJAX as well as adding new widgets to the platform. Finally, see how to add support for multiple languages and distribute your work to the global WordPress community. "WordPress Plugin Development Cookbook" provides you with tools to create any plugin you can imagine. &nbsp;</p>
Table of Contents (17 chapters)
WordPress Plugin Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Chapter 2. Plugin Framework Basics

In this chapter we will cover the following topics:

  • Creating a plugin file and header

  • Adding output content to page headers using plugin actions

  • Using WordPress path utility functions to load external files and images

  • Modifying the page title using plugin filters

  • Adding text after each item's content using plugin filters

  • Inserting link statistics tracking code in page body using plugin filters

  • Troubleshooting coding errors and printing variable content

  • Creating a new simple shortcode

  • Creating a new shortcode with parameters

  • Creating a new enclosing shortcode

  • Loading a stylesheet to format plugin output

  • Writing plugins using object-oriented PHP

Introduction

From its very first versions, WordPress was always designed as a very open platform. This openness was exemplified not only through its open source licensing and distribution model but also with its open plugin architecture, providing developers with the ability to deliver an even richer experience to its users.

While...