Book description
As one of the most popular open source content management systems available today, WordPress boasts a framework that allows you to easily customize and extend it through plugins. This comprehensive book shows you how plugins work, reviews the tools and APIs available in WordPress, and demonstrates how to extend the functionality of WordPress with plugins.
The trio of established authors provides a practical, solutions-based approach along with a collection of timely examples and plenty of code, all aimed at clearly explaining how to create a plugin file, work with users, integrate widgets, add menus and submenus, secure your plugins, and more. You will quickly come to understand how to develop custom plugins so that you can take WordPress to the next corporate and enterprise level.
Professional WordPress Plugin Development:
Details the range of complexity in plugins, from a very simple plugin to an extremely elaborate social network package
Addresses how to integrate into WordPress, save settings, create widgets and shortcodes, and implement uninstall
Learn the proper techniques for storing data, customizing user roles, and security best practices
Shares techniques for using custom post types and creating and using custom taxonomies
How to create plugins for WordPress Multisite networks
Integrate user and role management
Explores the HTTP API, JavaScript and AJAX, Cron, the Rewrite API, and more
Table of contents
- Copyright
- CREDITS
- ABOUT THE AUTHORS
- ACKNOWLEDGMENTS
- FOREWORD
- INTRODUCTION
- 1. An Introduction to Plugins
- 2. Plugin Foundation
-
3. Hooks
- 3.1. ACTIONS
- 3.2. FILTERS
- 3.3. USING HOOKS FROM WITHIN A CLASS
- 3.4. CREATING CUSTOM HOOKS
- 3.5. HOW TO FIND HOOKS
- 3.6. SUMMARY
- 4. Integrating in WordPress
-
5. Internationalization
-
5.1. INTERNATIONALIZATION AND LOCALIZATION
- 5.1.1. Why Internationalize?
- 5.1.2. Understanding Internationalization in Professional Work
- 5.1.3. Getting Your Plugin Ready for Translation
-
5.1.4. Echoing and Returning Strings
- 5.1.4.1. The __() Function
- 5.1.4.2. The _e() Function
- 5.1.4.3. The esc_attr__() Function
- 5.1.4.4. The esc_attr_e() Function
- 5.1.4.5. The esc_html__() Function
- 5.1.4.6. The esc_html_e() Function
- 5.1.4.7. The _x() Function
- 5.1.4.8. The _ex() Function
- 5.1.4.9. The esc_attr_x() Function
- 5.1.4.10. The esc_html_x() Function
- 5.1.4.11. The _n() Function
- 5.1.4.12. The _nx() Function
- 5.1.4.13. The _n_noop() Function
- 5.1.4.14. The _nx_noop() Function
- 5.1.5. Using Placeholders
- 5.1.6. Internationalizing JavaScript
- 5.2. CREATING TRANSLATION FILES
- 5.3. SUMMARY
-
5.1. INTERNATIONALIZATION AND LOCALIZATION
-
6. Plugin Security
- 6.1. SECURING YOUR PLUGIN
- 6.2. USER PERMISSIONS
- 6.3. NONCES
-
6.4. DATA VALIDATION AND SANITIZATION
- 6.4.1. The Need for Data Validation and Sanitization
- 6.4.2. Good Practice: Identifying Potentially Tainted Data
- 6.4.3. Validating or Sanitizing Input?
-
6.4.4. Validating and Sanitizing Cookbook
- 6.4.4.1. Integers
- 6.4.4.2. Arbitrary Pure Text Strings
- 6.4.4.3. Arbitrary Mixed Text Strings
- 6.4.4.4. Internal Identifier Strings
- 6.4.4.5. String Patterns
- 6.4.4.6. Email Strings
- 6.4.4.7. HTML (or XML)
- 6.4.4.8. URLs
- 6.4.4.9. JavaScript
- 6.4.4.10. Server or Environment Variables
- 6.4.4.11. Cookies
- 6.4.4.12. Arrays of Data
- 6.4.4.13. Data from a Defined Set
- 6.4.4.14. Database Queries
- 6.5. FORMATTING SQL STATEMENTS
- 6.6. SECURITY GOOD HABITS
- 6.7. SUMMARY
-
7. Plugin Settings
- 7.1. THE OPTIONS API
- 7.2. THE SETTINGS API
- 7.3. THE TRANSIENTS API
-
7.4. SAVING PER-USER SETTINGS
- 7.4.1. Crafting a Plugin
- 7.4.2. User Metadata
- 7.4.3. Saving User Metadata
- 7.4.4. Updating User Metadata
- 7.4.5. Getting User Metadata
- 7.4.6. Deleting User Metadata
- 7.4.7. Getting a User's ID
- 7.4.8. Adding Input Fields to a Profile Page
- 7.4.9. BOJ's Admin Lang Plugin
- 7.4.10. Per-User Settings: Best Practices
- 7.5. STORING DATA IN CUSTOM TABLES
- 7.6. SUMMARY
- 8. Users
-
9. HTTP API
- 9.1. HTTP REQUESTS CRASH COURSE
- 9.2. WORDPRESS' HTTP FUNCTIONS
- 9.3. PRACTICE: READING JSON FROM A REMOTE API
- 9.4. PRACTICE: SENDING DATA TO A REMOTE API
- 9.5. PRACTICE: READING ARBITRARY CONTENT
- 9.6. MAKE YOUR OWN PLUGIN REPOSITORY
- 9.7. SPECIAL CASE: FETCHING REMOTE FEEDS
- 9.8. SUMMARY
-
10. The Shortcode API
- 10.1. CREATING SHORTCODES
- 10.2. SHORTCODE TIPS
- 10.3. INTEGRATING GOOGLE MAPS
- 10.4. MORE SHORTCODE QUICK IDEAS
- 10.5. SUMMARY
-
11. Extending Posts: Metadata, Custom Post Types, and Taxonomies
-
11.1. CREATING CUSTOM POST TYPES
- 11.1.1. Post Type Possibilities
-
11.1.2. Registering a Post Type
-
11.1.2.1. register_post_type
- 11.1.2.1.1. public
- 11.1.2.1.2. show_ui
- 11.1.2.1.3. publicy_queryable
- 11.1.2.1.4. exclude_from_search
- 11.1.2.1.5. supports
- 11.1.2.1.6. labels
- 11.1.2.1.7. capability_type
- 11.1.2.1.8. capabilities
- 11.1.2.1.9. hierarchical
- 11.1.2.1.10. has_archive
- 11.1.2.1.11. query_var
- 11.1.2.1.12. rewrite
- 11.1.2.1.13. taxonomies
- 11.1.2.1.14. menu_position
- 11.1.2.1.15. menu_icon
- 11.1.2.1.16. show_in_nav_menus
- 11.1.2.1.17. can_export
- 11.1.2.1.18. register_meta_box_cb
- 11.1.2.1.19. permalink_epmask
- 11.1.2.2. Registering the Music Album Post Type
-
11.1.2.1. register_post_type
- 11.1.3. Setting Post Type Labels
- 11.1.4. Using Custom Capabilities
- 11.1.5. Attaching Existing Taxonomies
- 11.2. USING CUSTOM POST TYPES
- 11.3. POST METADATA
- 11.4. CREATING CUSTOM TAXONOMIES
- 11.5. USING CUSTOM TAXONOMIES
- 11.6. A POST TYPE AND TAXONOMY PLUGIN
- 11.7. SUMMARY
-
11.1. CREATING CUSTOM POST TYPES
-
12. JavaScript and Ajax in WordPress
- 12.1. JQUERY–A BRIEF INTRODUCTION
- 12.2. AJAX
-
12.3. ADDING JAVASCRIPT IN WORDPRESS
- 12.3.1. A Proper Way to Include Scripts
- 12.3.2. Where to Include Scripts
- 12.3.3. Adding Scripts Only When Needed
- 12.3.4. Dynamic Scripts in WordPress
- 12.4. AJAX IN WORDPRESS
- 12.5. SUMMARY
- 13. Cron
-
14. The Rewrite API
- 14.1. WHY REWRITE URLS
- 14.2. HOW WORDPRESS HANDLES QUERIES
- 14.3. PRACTICAL USES
- 14.4. SUMMARY
-
15. Multisite
- 15.1. DIFFERENCES
- 15.2. ENABLING MULTISITE IN WORDPRESS
-
15.3. MULTISITE FUNCTIONS
- 15.3.1. The Power of Blog ID
- 15.3.2. Common Functions
- 15.3.3. Switching and Restoring Sites
- 15.3.4. Network Content Shortcode Examples
- 15.3.5. A Network Content Widget Example
- 15.3.6. Creating a New Site
- 15.3.7. Multisite Site Options
- 15.3.8. Users in a Network
- 15.3.9. Multisite Super Admin
- 15.3.10. Checking the Site Owner
- 15.3.11. Network Stats
- 15.4. MULTISITE DATABASE SCHEMA
- 15.5. SUMMARY
- 16. Debugging and Optimizing
-
17. Marketing Your Plugin
- 17.1. CHOOSING A LICENSE FOR YOUR PLUGIN
- 17.2. SUBMITTING TO WORDPRESS.ORG
- 17.3. GETTING YOUR PLUGIN RENOWNED
- 17.4. SUMMARY
- 18. The Developer Toolbox
Product information
- Title: Professional WordPress® Plugin Development
- Author(s):
- Release date: March 2011
- Publisher(s): Wrox
- ISBN: 9780470916223
You might also like
book
WordPress 3 Plugin Development Essentials
Create your own powerful, interactive plugins to extend and add features to your WordPress site Everything …
book
WordPress for Web Developers: An Introduction for Web Professionals
WordPress for Web Developers is a complete guide for web designers and developers who want to …
video
Creating Plugins to Extend WordPress
In this Creating Plugins to Extend WordPress training course, expert author Joe Chellman will teach you …
book
WordPress Development Quick Start Guide
Learn core WordPress concepts and components to create modern WordPress-based solutions Key Features Learn the foundations …