(Ebook) Wordpress Plugin Development by Williams, Brad Tadlock, Justin James Jacoby, John Justin Tadlock John James Jacoby
(Ebook) Wordpress Plugin Development by Williams, Brad Tadlock, Justin James Jacoby, John Justin Tadlock John James Jacoby
com
https://ebooknice.com/product/wordpress-plugin-
development-11710648
OR CLICK HERE
DOWLOAD EBOOK
https://ebooknice.com/product/professional-wordpress-plugin-development-55460870
ebooknice.com
https://ebooknice.com/product/piano-adventures-performance-3b-52393612
ebooknice.com
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018
ebooknice.com
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
(Ebook) Crime, violence, and global warming by John P Crank; Linda S Jacoby ISBN
9780323265096, 032326509X
https://ebooknice.com/product/crime-violence-and-global-warming-4926620
ebooknice.com
(Ebook) Theory Construction and Model-Building Skills: A Practical Guide for Social
Scientists by James Jaccard, Jacob Jacoby ISBN 9781462542437, 1462542433
https://ebooknice.com/product/theory-construction-and-model-building-skills-a-
practical-guide-for-social-scientists-12309446
ebooknice.com
Table of Contents
COVER
FOREWORD
INTRODUCTION
WHO THIS BOOK IS FOR
WHAT YOU NEED TO USE THIS BOOK
WHAT THIS BOOK COVERS
HOW THIS BOOK IS STRUCTURED
CONVENTIONS
SOURCE CODE
ERRATA
1 An Introduction to Plugins
WHAT IS A PLUGIN?
AVAILABLE PLUGINS
ADVANTAGES OF PLUGINS
INSTALLING AND MANAGING PLUGINS
SUMMARY
2 Plugin Framework
REQUIREMENTS FOR PLUGINS
BEST PRACTICES
PLUGIN HEADER
DETERMINING PATHS
ACTIVATE/DEACTIVATE FUNCTIONS
UNINSTALL METHODS
CODING STANDARDS
SUMMARY
3 Dashboard and Settings
ADDING MENUS AND SUBMENUS
PLUGIN SETTINGS
THE OPTIONS API
THE SETTINGS API
KEEPING IT CONSISTENT
SUMMARY
4 Security and Performance
SECURITY OVERVIEW
USER PERMISSIONS
NONCES
DATA VALIDATION AND SANITIZATION
FORMATTING SQL STATEMENTS
SECURITY GOOD HABITS
PERFORMANCE OVERVIEW
CACHING
TRANSIENTS
SUMMARY
5 Hooks
UNDERSTANDING HOOKS
ACTIONS
FILTERS
USING HOOKS FROM WITHIN A CLASS
USING HOOKS WITH ANONYMOUS FUNCTIONS
CREATING CUSTOM HOOKS
FINDING HOOKS
SUMMARY
6 JavaScript
REGISTERING SCRIPTS
ENQUEUEING SCRIPTS
LIMITING SCOPE
LOCALIZING SCRIPTS
INLINE SCRIPTS
OVERVIEW OF BUNDLED SCRIPTS
POLYFILLS
YOUR CUSTOM SCRIPTS
jQuery
BACKBONE/UNDERSCORE
REACT
SUMMARY
7 Blocks and Gutenberg
WHAT IS GUTENBERG?
TOURING GUTENBERG
PRACTICAL EXAMPLES
TECHNOLOGY STACK OF GUTENBERG
“HELLO WORLD!” BLOCK
WP‐CLI SCAFFOLDING
CREATE‐GUTEN‐BLOCK TOOLKIT
BLOCK DIRECTORY
SUMMARY
8 Content
CREATING CUSTOM POST TYPES
POST METADATA
META BOXES
CREATING CUSTOM TAXONOMIES
USING CUSTOM TAXONOMIES
A POST TYPE, POST METADATA, AND TAXONOMY
PLUGIN
SUMMARY
9 Users and User Data
WORKING WITH USERS
ROLES AND CAPABILITIES
LIMITING ACCESS
CUSTOMIZING ROLES
SUMMARY
10 Scheduled Tasks
WHAT IS CRON?
SCHEDULING CRON EVENTS
TRUE CRON
PRACTICAL USE
SUMMARY
11 Internationalization
INTERNATIONALIZATION AND LOCALIZATION
CREATING TRANSLATION FILES
SUMMARY
12 REST API
WHAT THE REST API IS
WHAT YOU CAN DO WITH THE REST API
ACCESSING THE WORDPRESS REST API
THE HTTP API
WORDPRESS’ HTTP FUNCTIONS
BRINGING IT ALL TOGETHER
SUMMARY
13 Multisite
TERMINOLOGY
ADVANTAGES OF MULTISITE
ENABLING MULTISITE IN WORDPRESS
MULTISITE FUNCTIONS
DATABASE SCHEMA
QUERY CLASSES
OBJECT CLASSES
SUMMARY
14 The Kitchen Sink
QUERYING AND DISPLAYING POSTS
SHORTCODES
WIDGETS
DASHBOARD WIDGETS
REWRITE RULES
THE HEARTBEAT API
SUMMARY
15 Debugging
COMPATIBILITY
DEBUGGING
ERROR LOGGING
QUERY MONITOR
SUMMARY
16 The Developer Toolbox
CORE AS REFERENCE
PLUGIN DEVELOPER HANDBOOK
CODEX
TOOL WEBSITES
COMMUNITY RESOURCES
TOOLS
SUMMARY
INDEX
END USER LICENSE AGREEMENT
List of Tables
Chapter 3
TABLE 3-1: List of Core Sections and Fields
Chapter 12
TABLE 12-1: Main HTTP Status Codes
TABLE 12-2: HTTP Status Code Classes
TABLE 12-3: Default Settings of wp_remote_ Functions
Optional Parameters
List of Illustrations
Chapter 1
FIGURE 1-1: Loading a page in WordPress
FIGURE 1-2: Plugins menu
FIGURE 1-3: Install Now button
FIGURE 1-4: Types and statuses for plugins
Chapter 3
FIGURE 3-1: Custom registered menu
FIGURE 3-2: Submenus
FIGURE 3-3: Submenu labeled PDEV Settings
FIGURE 3-4: Plugin management page
FIGURE 3-5: Error message
FIGURE 3-6: Section appended
FIGURE 3-7: Singular field
FIGURE 3-8: Heading levels
FIGURE 3-9: Dashicons
FIGURE 3-10: Dismissable notices
FIGURE 3-11: WordPress-styled button
FIGURE 3-12: Link styled to look like a button
FIGURE 3-13: WordPress-like options
FIGURE 3-14: Table style
FIGURE 3-15: Pagination style
Chapter 4
FIGURE 4-1: Insufficient privileges
FIGURE 4-2: Expired link message
FIGURE 4-3: Rogue JavaScript running
FIGURE 4-4: Related Posts list
Chapter 7
FIGURE 7-1: Classic Editor, not covered in this chapter
FIGURE 7-2: Gutenberg
FIGURE 7-3: Block Library menu
FIGURE 7-4: Categories of blocks
FIGURE 7-5: View options
FIGURE 7-6: Sidebar's Document menu
FIGURE 7-7: Sidebar's Block menu and formatting toolbar
FIGURE 7-8: WooCommerce blocks
FIGURE 7-9: Newest Products block
FIGURE 7-10: Event Calendar blocks
FIGURE 7-11: Post Type Switcher plugin
FIGURE 7-12: webpack finishing successfully
FIGURE 7-13: Our “Hello world!” block in the Block
Library
FIGURE 7-14: Selecting our new block
FIGURE 7-15: Editing a post
FIGURE 7-16: WP-CLI scaffold generated
FIGURE 7-17: Build Step 1
FIGURE 7-18: Build Step 2
FIGURE 7-19: Build Step 3
FIGURE 7-20: My Block in Block Library
FIGURE 7-21: My Block in Content Area
Chapter 8
FIGURE 8-1: Books admin menu and screen
FIGURE 8-2: Tags submenu item
FIGURE 8-3: Genres submenu
Chapter 9
FIGURE 9-1: New form on the user edit page
FIGURE 9-2: New roles
Chapter 10
FIGURE 10-1: Scheduled Events page
FIGURE 10-2: Number output
Chapter 11
FIGURE 11-1: Settings box
Chapter 12
FIGURE 12-1: Unformatted JSON
FIGURE 12-2: Formatted JSON
FIGURE 12-3: Post results
FIGURE 12-4: Error message
FIGURE 12-5: Authentication worked
FIGURE 12-6: “My Time at Crystal Lake” post
Chapter 13
FIGURE 13-1: Tools ➪ Network menu options
Chapter 14
FIGURE 14-1: Simple post list
FIGURE 14-2: Widgets admin screen
FIGURE 14-3: Favorites list
FIGURE 14-4: Custom dashboard widget
FIGURE 14-5: Custom dashboard widget
Chapter 15
FIGURE 15-1: Admin Toolbar menu item
FIGURE 15-2: Query Monitor interface
FIGURE 15-3: Database queries
Chapter 16
FIGURE 16-1: Function with parameters
FIGURE 16-2: Codex search options
FIGURE 16-3: WordPress PHPXref
FIGURE 16-4: Function list
PROFESSIONAL
WORDPRESS® PLUGIN
DEVELOPMENT
Second Edition
Brad Williams
Justin Tadlock
CONVENTIONS
To help you get the most from the text and keep track of what's
happening, we've used a number of conventions throughout the
book.
NOTE The note label indicates notes, tips, hints, tricks, and
asides to the current discussion.
SOURCE CODE
As you work through the examples in this book, you may choose
either to type in all the code manually or to use the source code files
that accompany the book. All the source code used in this book is
available for download at www.wiley.com/go/prowordpressdev2e on
the Downloads tab.
NOTE Because many books have similar titles, you may find it
easiest to search by ISBN; this book's ISBN is 978‐1‐119‐66694‐3.
ERRATA
We make every effort to ensure that there are no errors in the text
or in the code. However, no one is perfect, and mistakes do occur. If
you find an error in one of our books, such as a spelling mistake or
faulty piece of code, we would be grateful for your feedback. By
sending in errata, you may save another reader hours of frustration,
and at the same time, you will be helping us provide even higher‐
quality information.
To find the errata page for this book, go to www.wiley.com and locate
the title using the Search box. Then, on the book details page, click
the Errata link. On this page, you can view all errata that have been
submitted for this book and posted by editors. If you don't spot
“your” error on the Errata page, go to support.wiley.com and follow
the directions to contact technical support and open a ticket to
submit the error. We'll check the information and, if appropriate,
post a message to the book's errata page and fix the problem in
subsequent printings of the book.
1
An Introduction to Plugins
WHAT'S IN THIS CHAPTER?
Understanding what a plugin is
Using available WordPress APIs
Finding examples of popular plugins
Separating plugin and theme functionality
Managing and installing plugins
Understanding types of WordPress plugins
WHAT IS A PLUGIN?
A plugin in WordPress is a PHP‐based script that extends or alters
the core functionality of WordPress. Quite simply, plugins are files
installed in WordPress to add a feature, or set of features, to
WordPress. Plugins can range in complexity from a simple social
networking plugin to an extremely elaborate eCommerce package.
There is no limit to what a plugin can do in WordPress; because of
this, there is no shortage of plugins available for download.
There are additional, lesser known APIs that exist within the
WordPress Core software. To view a full list, visit the Core
Developer Handbook:
https://make.wordpress.org/core/handbook/best-practices/core-
apis
You can see that the code first checks to see whether a wp_mail()
function already exists using the function_exists() PHP function.
If you created your own custom wp_mail() function, that will be
used; if not, the WordPress Core version of wp_mail() will be used.
You can use some predefined functions during specific plugin tasks,
such as when a plugin is activated or deactivated and even when a
plugin is uninstalled. Chapter 2, “Plugin Framework,” covers these
functions in detail.
ADVANTAGES OF PLUGINS
WordPress offers many advantages when using plugins. It's
important to understand the advantages of building plugins to truly
understand why you should spend time building them. This can also
help when determining the need for a specific plugin in WordPress.
WASHINGTON IRVING
1783–1859
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com