SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
WordPress Plugin Development Cookbook, Third Edition
Toggle community discussions
Close
Content
Files
Bookmarks
Preface
WordPress Plugin Development Cookbook
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Share Your Thoughts
1
Preparing a Local Development Environment
Technical requirements
Installing a local web server on your computer
How to do it…
How it works…
There's more…
Creating a local version control repository
How to do it…
How it works…
There's more…
Installing a dedicated code editor/text editor
Getting ready
How to do it…
How it works…
There's more…
Plugin Framework Basics
Technical requirements
Creating a plugin file and header
Getting ready
How to do it...
How it works...
See also
Adding output content to page headers using plugin actions
How to do it...
How it works...
There's more...
See also
Using WordPress path utility functions to load external files and images
How to do it...
How it works...
There's more...
See also
Modifying the site generator meta tag using plugin filters
How to do it...
How it works...
There's more...
See also
Adding text after each item's content using plugin filters
How to do it...
How it works...
There's more...
See also
Inserting link tracking code in the page body using plugin filters
Getting ready
How to do it...
How it works...
See also
Troubleshooting coding errors and printing variable content
How to do it...
How it works...
There's more...
See also
Creating a new simple shortcode
How to do it...
How it works...
See also
Creating a new shortcode with parameters
How to do it...
How it works...
See also
Creating a new enclosing shortcode
How to do it...
How it works...
See also
Loading a style sheet to format plugin output
Getting ready
How to do it...
How it works...
See also
Writing plugins using object-oriented PHP
Getting ready
How to do it...
How it works...
There's more…
See also
User Settings and Administration Pages
Technical requirements
Creating default user settings on plugin initialization
How to do it...
How it works...
There's more...
See also
Storing user settings using arrays
Getting ready
How to do it...
How it works...
See also
Removing plugin data on deletion
Getting ready
How to do it...
How it works...
See also
Creating an administration page menu item in the settings menu
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a multi-level administration menu
How to do it...
How it works...
There's more…
See also
Rendering the admin page contents using HTML
Getting ready
How to do it...
How it works...
There's more...
See also
Processing and storing plugin configuration data
Getting ready
How to do it...
How it works...
See also
Displaying a confirmation message when options are saved
Getting ready
How to do it...
How it works...
See also
Adding custom help pages
Getting ready
How to do it...
How it works...
See also
Rendering the admin page contents using the Settings API
How to do it...
How it works...
There's more...
See also
Accessing user settings from action and filter hooks
Getting ready
How to do it...
How it works...
See also
Formatting admin pages using meta boxes
Getting ready
How to do it...
How it works...
See also
Splitting admin code from the main plugin file to optimize site performance
Getting ready
How to do it...
How it works...
See also
Storing style sheet data in user settings
Getting ready
How to do it...
How it works...
See also
Managing multiple sets of user settings from a single admin page
Getting ready
How to do it...
How it works...
See also
Creating a network-level plugin with admin pages
Getting ready
How to do it...
How it works...
See also
The Power of Custom Post Types
Technical requirements
Creating a custom post type
Getting ready
How to do it...
How it works...
There's more...
See also
Adding a new section to the custom post type editor
Getting ready
How to do it...
How it works...
See also
Displaying single custom post type items using a custom layout
Getting ready
How to do it...
How it works...
See also
Tailoring search output for custom post type items
Getting ready
How to do it…
How it works…
See also
Displaying custom post type data in shortcodes
Getting ready
How to do it...
How it works...
See also
Adding custom categories for custom post types
Getting ready
How to do it...
How it works...
See also
Adding custom fields to categories
Getting ready
How to do it...
How it works...
See also
Hiding the category editor from the custom post type editor
Getting ready
How to do it...
How it works...
See also
Displaying additional columns in the custom post list page
Getting ready
How to do it...
How it works...
See also
Adding filters for custom categories to the custom post list page
Getting ready
How to do it...
How it works...
See also
Adding Quick Edit fields for custom categories
Getting ready
How to do it...
How it works...
Updating the page title to include custom post data using plugin filters
Getting ready
How to do it...
How it works...
Customizing Post and Page Editors
Technical requirements
Capturing and displaying information using custom meta boxes
Getting ready
How to do it...
How it works...
There's more...
Displaying custom post data using filter functions
Getting ready
How to do it...
How it works...
See also
Hiding the Custom Fields section in the post editor
Getting ready
How to do it...
How it works...
Extending the post editor to attach custom files with the media uploader
Getting ready
How to do it...
How it works...
See also
Extending the Block Editor
Technical requirements
Setting up a block development environment and creating a simple block
Getting ready
How to do it...
How it works...
There's more...
See also
Creating an editable blockquote block
Getting ready
How to do it...
How it works...
See also
Creating a new WordPress REST endpoint
Getting ready
How to do it...
How it works...
See also
Creating a server-side rendering block that leverages an existing shortcode
Getting ready
How to do it...
How it works...
See also
Accepting User Content Submissions
Technical requirements
Creating a client-side content submission form
Getting ready
How to do it...
How it works...
See also
Saving user-submitted content in custom post types
Getting ready
How to do it...
How it works...
There's more...
See also
Sending email notifications upon new submissions
Getting ready
How to do it...
How it works...
See also
Implementing a CAPTCHA on user forms using an online service
Getting ready
How to do it...
How it works...
See also
Using a local library to implement a CAPTCHA on user forms
Getting ready
How to do it...
How it works...
See also
Customizing User Data
Technical requirements
Adding custom fields to the user editor
Getting ready
How to do it...
How it works...
See also
Processing and storing custom user data
Getting ready
How to do it...
How it works...
See also
Displaying new user data on the user list page
Getting ready
How to do it...
How it works...
See also
Using custom user data in an enclosing shortcode
Getting ready
How to do it...
How it works...
See also
Leveraging JavaScript, jQuery, and AJAX Scripts
Technical requirements
Safely loading jQuery onto WordPress web pages
Getting ready
How to do it...
How it works...
There's more...
Displaying a pop-up dialog using the built-in ThickBox plugin
Getting ready
How to do it...
How it works...
There's more...
Controlling pop-up dialog display using shortcodes
Getting ready
How to do it...
How it works...
See also
Displaying a calendar day selector using the Datepicker plugin
Getting ready
How to do it...
How it works...
Adding tooltips to admin page form fields using the TipTip plugin
Getting ready
How to do it...
How it works...
See also
Using AJAX to dynamically update partial page contents
Getting ready
How to do it...
How it works...
See also
Adding New Widgets to the WordPress Library
Technical requirements
Creating a new widget in WordPress
Getting ready
How to do it...
How it works...
See also
Displaying widget configuration options
Getting ready
How to do it...
How it works...
See also
Validating widget configuration options
Getting ready
How to do it...
How it works...
See also
Adding a custom dashboard widget
Getting ready
How to do it...
How it works...
See also
Adding a custom widget to the network dashboard
Getting ready
How to do it...
How it works...
See also
Fetching, Caching, and Regularly Updating External Site Data
Technical requirements
Displaying RSS items from an external feed
Getting ready
How to do it…
How it works...
There's more…
See also
Optimizing plugin performance by storing external data using transients
Getting ready
How to do it...
How it works...
See also
Scheduling plugin data updates using WP-Cron
Getting ready
How to do it...
There's more…
See also
Enabling Plugin Internationalization
Technical requirements
Changing the WordPress site language configuration
Getting ready
How to do it...
How it works...
Adapting default user settings for translation
Getting ready
How to do it...
How it works...
See also
Making admin page code ready for translation
Getting ready
How to do it...
How it works...
See also
Modifying shortcode output for translation
Getting ready
How to do it...
How it works...
See also
Translating text strings using Poedit
Getting ready
How to do it...
How it works...
There's more...
See also
Loading a language file in the plugin initialization
Getting ready
How to do it...
How it works...
There's more...
See also
Distributing Your Plugin on WordPress.org
Technical requirements
Creating a README file for your plugin
Getting ready
How to do it...
How it works...
There's more...
Applying for your plugin to be hosted on WordPress.org
How to do it...
How it works...
See also
Uploading your plugin using Subversion
Getting ready
How to do it...
How it works...
There's more...
See also
Providing plugin banner and thumbnail images
Getting ready
How to do it...
How it works...
See also
Open text modal
Community Questions
Close