Helion


Szczegóły ebooka

WordPress Plugin Development Cookbook - Third Edition

WordPress Plugin Development Cookbook - Third Edition


WordPress is one of the most widely used, powerful, and open content management systems (CMSs). Whether you're a site owner trying to find the right extension, a developer who wants to contribute to the community, or a website developer working to fulfill a client's needs, learning how to extend WordPress' capabilities will help you to unleash its full potential. This book will help you become familiar with API functions to create secure plugins with easy-to-use administration interfaces.

This third edition contains new recipes and up-to-date code samples, including new chapters on creating custom blocks for the block editor and integrating data from external sources. From one chapter to the next, you'll learn how to create plugins of varying complexity, ranging from a few lines of code to complex extensions that provide intricate new capabilities. You'll start by using the basic mechanisms provided in WordPress to create plugins, followed by recipes covering how to design administration panels, enhance the post editor with custom fields, store custom data, and even create custom blocks. You'll safely incorporate dynamic elements into web pages using scripting languages, learn how to integrate data from external sources, and build new widgets that users will be able to add to WordPress sidebars and widget areas.

By the end of this book, you will be able to create WordPress plugins to perform any task you can imagine.

  • WordPress Plugin Development Cookbook
  • Third Edition
  • 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
      • Theres more
      • See also
    • Get in touch
    • Share Your Thoughts
  • Chapter 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
  • Chapter 2: 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
  • Chapter 3: 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
  • Chapter 4: 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...
  • Chapter 5: 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
  • Chapter 6: 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
  • Chapter 7: 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
  • Chapter 8: 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
  • Chapter 9: 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
  • Chapter 10: 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
  • Chapter 11: 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
  • Chapter 12: 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
  • Chapter 13: 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
    • Why subscribe?
  • Other Books You May Enjoy
    • Packt is searching for authors like you

  • Tytuły: WordPress Plugin Development Cookbook - Third Edition
  • Autor: Yannick Lefebvre
  • Tytuł oryginału: WordPress Plugin Development Cookbook - Third Edition
  • ISBN Ebooka: 9781801816939, 9781801816939
  • Data wydania: 2022-03-31
  • Identyfikator pozycji: e_2t5e
  • Kategorie:
  • Wydawca: Packt Publishing