跳转到主要内容

书籍

WordPress Plugin Handbook

中文译本:WordPress 插件开发手册 (https://docs.cocobook.com/books/wp-plugin-handbook-zh)
WordPress Plugin Handbook。内容保持上游原样。

21 章103 页更新于 1 天前

开始阅读

目录103

  1. 第 1 章 Administration Menus 3 页
    1. 1.1 Administration Menus Administration Menus are the interfaces displayed in WordPress Administration. They allow you to add option... 6 天前
    2. 1.2 Sub-Menus Add a Sub-Menu To add a new Sub-menu to WordPress Administration, use the add_submenu_page() function. add... 6 天前
    3. 1.3 Top-Level Menus Add a Top-Level Menu To add a new Top-level menu to WordPress Administration, use the add_menu_page() func... 6 天前
  2. 第 2 章 Assets 1 页
    1. 2.1 index Silence is golden! 6 天前
  3. 05 developer-plugins-handbook Welcome to the WordPress Plugin Developer Handbook; are you ready to jump right in to the world of WordPres... 6 天前
  4. 第 3 章 Credits 1 页
    1. 3.1 Credits List of credits brought over manually. @2Neil @aternus @awoods @blobaugh @code_poet @cyrijones @danielbachh... 6 天前
  5. 07 Plugin Handbook Welcome to the WordPress Plugin Developer Handbook; are you ready to jump right in to the world of WordPres... 6 天前
  6. 第 4 章 Cron 5 页
    1. 4.1 Cron What is WP-Cron WP-Cron is how WordPress handles scheduling time-based tasks in WordPress. Several WordPres... 6 天前
    2. 4.2 Hooking WP-Cron Into the System Task Scheduler As previously mentioned, WP-Cron does not run continuously, which can be an issue if there are critical tas... 6 天前
    3. 4.3 Scheduling WP Cron Events The WP Cron system uses hooks to add new scheduled tasks. Adding the Hook In order to get your task to run ... 6 天前
    4. 4.4 Testing of WP-Cron WP-CLI Cron jobs can be tested using WP-CLI. It offers commands like wp cron event list and wp cron event... 6 天前
    5. 4.5 Understanding WP-Cron Scheduling Unlike a traditional system cron that schedules tasks for specific times (e.g. "every hour at 5 minutes pas... 6 天前
  7. 第 5 章 Developer Tools 3 页
    1. 5.1 Developer Tools There are a wide variety of tools available to help with plugin development. Some of them are run in your d... 6 天前
    2. 5.2 Debug Bar and Add-Ons The Debug Bar is a plugin that adds a debug menu to the admin bar that shows query, cache, and other helpfu... 6 天前
    3. 5.3 Helper Plugins ## Plugin Check Plugin Check is a tool for testing whether your plugin meets the required standards for the... 6 天前
  8. 第 6 章 Hooks 5 页
    1. 6.1 Hooks Hooks are a way for one piece of code to interact/modify another piece of code at specific, pre-defined spo... 6 天前
    2. 6.2 Actions Actions are one of the two types of Hooks. They provide a way for running a function at a specific point in... 6 天前
    3. 6.3 Advanced Topics Removing Actions and Filters Sometimes you want to remove a callback function from a hook that another plug... 6 天前
    4. 6.4 Custom Hooks An important, but often overlooked practice is using custom hooks in your plugin so that other developers c... 6 天前
    5. 6.5 Filters Filters are one of the two types of Hooks. They provide a way for functions to modify data during the execu... 6 天前
  9. 第 7 章 Http Api 1 页
    1. 7.1 HTTP API Introduction HTTP stands for Hypertext Transfer Protocol and is the foundational communication protocol for... 6 天前
  10. 第 8 章 Internationalization 4 页
    1. 8.1 Internationalization What is Internationalization? Internationalization is the process of developing a plugin so it can easily b... 6 天前
    2. 8.2 How to Internationalize Your Plugin In order to make a string translatable in your application you have to wrap the original string in a call t... 6 天前
    3. 8.3 Localization What is localization? Localization describes the subsequent process of translating an internationalized plu... 6 天前
    4. 8.4 index Internationalization Security Security is often overlooked when talking about internationalization, but the... 6 天前
  11. 第 9 章 Intro 2 页
    1. 9.1 Introduction to Plugin Development Welcome to the Plugin Developer Handbook. Whether you're writing your first plugin or your fiftieth, we hop... 6 天前
    2. 9.2 What is a Plugin? Plugins are packages of code that extend the core functionality of WordPress. WordPress plugins are made up... 6 天前
  12. 第 10 章 Javascript 6 页
    1. 10.1 JavaScript JavaScript is an important component in many WordPress plugins. WordPress comes with a variety of JavaScri... 6 天前
    2. 10.2 AJAX What is AJAX? AJAX is the acronym for Asynchronous JavaScript And XML. XML is a data exchange format and UX... 6 天前
    3. 10.3 Server Side PHP and Enqueuing There are two parts to the server side PHP script that are needed to implement AJAX communication. First we... 6 天前
    4. 10.4 Heartbeat API The Heartbeat API is a simple server polling API built in to WordPress, allowing near-real-time frontend up... 6 天前
    5. 10.5 jQuery Using jQuery Your jQuery script runs on the user's browser after your WordPress webpage is received. A basi... 6 天前
    6. 10.6 Summary Here are all the example code snippets from the preceding discussion, assembled into two complete code page... 6 天前
  13. 第 11 章 Metadata 4 页
    1. 11.1 Metadata Metadata is information about information. In the case of WordPress, it's information associated with posts... 6 天前
    2. 11.2 Custom Meta Boxes What is a Meta Box? When a user edits a post, the edit screen is composed of several default boxes: Editor,... 6 天前
    3. 11.3 Managing Post Metadata Adding Metadata Adding metadata can be done quite easily with add_post_meta(). The function accepts a pos... 6 天前
    4. 11.4 Rendering Post Metadata Here is a non exhaustive list of functions and template tags used to get and render Post Metadata: get_post... 6 天前
  14. 第 12 章 Plugin Basics 7 页
    1. 12.1 Plugin Basics Getting Started At its simplest, a WordPress plugin is a PHP file with a WordPress plugin header comment. I... 6 天前
    2. 12.2 Activation / Deactivation Hooks Activation and deactivation hooks provide ways to perform actions when plugins are activated or deactivated... 6 天前
    3. 12.3 Best Practices Here are some best practices to help organize your code so it works well alongside WordPress core and other... 6 天前
    4. 12.4 Determining Plugin and Content Directories When coding WordPress plugins you often need to reference various files and folders throughout the WordPres... 6 天前
    5. 12.5 Header Requirements As described in Getting Started, the main PHP file should include a header comment that tells WordPress tha... 6 天前
    6. 12.6 Including a Software License Most WordPress plugins are released under the GPL, which is the same license that WordPress itself uses. Ho... 6 天前
    7. 12.7 Uninstall Methods Your plugin may need to do some clean-up when it is uninstalled from a site. A plugin is considered uninsta... 6 天前
  15. 第 13 章 Post Types 3 页
    1. 13.1 Custom Post Types WordPress stores the Post Types in the posts table allowing developers to register Custom Post Types along... 6 天前
    2. 13.2 Registering Custom Post Types WordPress comes with five default post types: post, page, attachment, revision, and menu. While develo... 6 天前
    3. 13.3 Working with Custom Post Types Custom Post Type Templates You can create custom templates for your custom post types. In the same way post... 6 天前
  16. 第 14 章 Privacy 5 页
    1. 14.1 Privacy Are you writing a plugin that handles personal data – things like names, addresses, and other things that c... 6 天前
    2. 14.2 Adding the Personal Data Eraser to Your Plugin In WordPress 4.9.6, new tools were added to make compliance easier with laws like the European Union's Gene... 6 天前
    3. 14.3 Adding the Personal Data Exporter to Your Plugin In WordPress 4.9.6, new tools were added to make compliance easier with laws like the European Union's Gene... 6 天前
    4. 14.4 Privacy Related Options, Hooks and Capabilities The privacy tools were originally introduced in WordPress 4.9.6. These tools are designed to allow (and enc... 6 天前
    5. 14.5 index Suggesting text for the site privacy policy Every plugin that collects, uses, or stores user data, or passe... 6 天前
  17. 第 15 章 Rest Api 7 页
    1. 15.1 REST API WordPress 4.4 introduced the infrastructure for a REST API.  The REST API provides an easy way to get data ... 6 天前
    2. 15.2 Controller Classes Overview When writing endpoints it can be helpful to use a controller class to handle the functionality of ... 6 天前
    3. 15.3 Requests Overview The REST API is very simple in many ways. There is input, known as the request. The input is inter... 6 天前
    4. 15.4 Responses Overview Responses in the API are what holds all of the data we want. If we made a mistake in our request, ... 6 天前
    5. 15.5 REST API Overview The WordPress REST API brings many new features to WordPress. The REST API uses JSON (JavaScript Object Not... 6 天前
    6. 15.6 Routes & Endpoints The REST API provides a way to match URIs to various resources in our WordPress installation. By default, i... 6 天前
    7. 15.7 Schema Overview Schema is data that tells us how are other data should be structured. Most databases implement som... 6 天前
  18. 第 16 章 Security 6 页
    1. 16.1 Plugin Security This content has been moved to the Security page in the Common APIs Handbook. But there is more content to ... 6 天前
    2. 16.2 Checking User Capabilities If your plugin allows users to submit data—be it on the Admin or the Public side—it should check for User C... 6 天前
    3. 16.3 Data Validation This content has been moved to the Data Validation page in the Common APIs Handbook. 6 天前
    4. 16.4 Nonces This content has been moved to the Nonces page in the Common APIs Handbook. 6 天前
    5. 16.5 Securing (sanitizing) Input This content has been moved to the Sanitizing Data page in the Common APIs Handbook. 6 天前
    6. 16.6 Securing (escaping) Output This content has been moved to the Escaping Data page in the Common APIs Handbook. 6 天前
  19. 第 17 章 Settings 5 页
    1. 17.1 Settings WordPress provides two core APIs to make the administrative interfaces easy to build, secure, and consisten... 6 天前
    2. 17.2 Custom Settings Page Creating a custom settings page includes the combination of: creating an administration menu, using Setting... 6 天前
    3. 17.3 Options API The Options API, added in WordPress 1.0, allows creating, reading, updating and deleting of WordPress optio... 6 天前
    4. 17.4 Settings API The Settings API, added in WordPress 2.7, allows admin pages containing settings forms to be managed semi-a... 6 天前
    5. 17.5 Using Settings API Adding Settings You must define a new setting using register_setting(), it will create an entry in the {$... 6 天前
  20. 第 18 章 Shortcodes 5 页
    1. 18.1 Shortcodes As a security precaution, running PHP inside WordPress content is forbidden; to allow dynamic interactions ... 6 天前
    2. 18.2 Basic Shortcodes Add a Shortcode It is possible to add your own shortcodes by using the Shortcode API. The process involves ... 6 天前
    3. 18.3 Enclosing Shortcodes The are two scenarios for using shortcodes: The shortcode is a self-closing tag like we seen in the Basic S... 6 天前
    4. 18.4 Shortcodes with Parameters Now that we know how to create a basic shortcode and how to use it as self-closing and enclosing, we will l... 6 天前
    5. 18.5 TinyMCE Enhanced Shortcodes It's possible to parse shortcodes within the visual editor of TinyMCE and make them render actual content, ... 6 天前
  21. 第 19 章 Taxonomies 3 页
    1. 19.1 Taxonomies A Taxonomy is a fancy word for the classification/grouping of things. Taxonomies can be hierarchical (with ... 6 天前
    2. 19.2 Term Splitting (WordPress 4.2) This information is here for historical purposes. If you're not interested in how terms worked prior to 201... 6 天前
    3. 19.3 Working with Custom Taxonomies Introduction to Taxonomies To understand what Taxonomies are and what they do please read the Taxonomy intr... 6 天前
  22. 第 20 章 Users 4 页
    1. 20.1 Users A User is an access account with corresponding capabilities within the WordPress installation. Each WordPre... 6 天前
    2. 20.2 Roles and Capabilities Roles and capabilities are two important aspects of WordPress that allow you to control user privileges. Wo... 6 天前
    3. 20.3 Working with User Metadata Introduction WordPress' users table was designed to contain only the essential information about the user.... 6 天前
    4. 20.4 Working with Users Adding Users To add a user you can use wp_create_user() or wp_insert_user(). wp_create_user() creates a u... 6 天前
  23. 第 21 章 Wordpress Org 21 页
    1. 21.1 The WordPress.org Plugin Directory WordPress.org offers free hosting to anyone who wishes to develop a plugin in our directory. All plugins ho... 6 天前
    2. 21.2 Add Your Plugin to the Block Directory There are two main directory listings of block related plugins. Plugins that are only blocks Plugins that c... 6 天前
    3. 21.3 Alerts and Warnings When you visit plugin pages on WordPress.org, you may notice special alerts or warnings. These exist to hel... 6 天前
    4. 21.4 Block Specific Plugin Guidelines [info]All Block Specific plugins must also comply with the overall plugin guidelines. These additional guid... 6 天前
    5. 21.5 Common issues This is a compilation of some of the most common issues the Plugins Team encounters when reviewing plugins.... 6 天前
    6. 21.6 Compliance Disclaimers As of April 12, 2018, Guideline 9 (Developers and their plugins must not do anything illegal, dishonest, or... 6 天前
    7. 21.7 Detailed Plugin Guidelines [info]Adding a Block Only plugin? Please read the Block Specific Guidelines.[/info] The Plugin Directory Th... 6 天前
    8. 21.8 Using Subversion SVN, or Subversion, is a version control system similar to Git. It can be used via command line, or one of ... 6 天前
    9. 21.9 Plugin Readmes This page will explain some aspects of the plugin directory, and explain of the more obvious aspects which ... 6 天前
    10. 21.10 Planning, Submitting, and Maintaining Plugins You've written the next Hello Dolly and you want the world to use it. What should you do? 1. Test once and ... 6 天前
    11. 21.11 index The assets folder in your plugin is where you can store images (like plugin headers, icons, and screenshot... 6 天前
    12. 21.12 Plugin Developer FAQ There are lot of ins and outs to hosting WordPress plugins. Please take a minute to see if your question is... 6 天前
    13. 21.13 Managing Your Plugin's Security The security of code in WordPress plugins is taken very seriously. [warning]If you have found a plugin with... 6 天前
    14. 21.14 Reporting Plugin Security Issues [warning]Please do not report security issues with WordPress Core to the plugin team. To report an issue wi... 6 天前
    15. 21.15 Preventing WordPress from Updating Your External Plugin [warning]The information on this page is meant for use only on plugins not hosted on WordPress.org. Do not ... 6 天前
    16. 21.16 Previews and Blueprints If you haven’t noticed it yet, the WordPress Playground is an amazing feature that lets anyone safely run a... 6 天前
    17. 21.17 Release Confirmation Emails In order to better protect plugins from inadvertent releases, we’ve added a new opt-in feature for plugins:... 6 天前
    18. 21.18 Special User Roles and Capabilities Every person who pushes code for, or aids in support for, a plugin is required to have their OWN individual... 6 天前
    19. 21.19 Take Over an Existing Plugin People cease development on their plugins for a variety of reasons. Instead of letting those plugins stagna... 6 天前
    20. 21.20 Transferring Your Plugin to a New Owner While any plugin can have an unlimited number of committers and support reps, there is only one official ow... 6 天前
    21. 21.21 Using the Forums With the free plugin hosting, all plugin developers are given access to use the support forums and the revi... 6 天前