Docs: Add examples of possible names for various hooks whose name contains a dynamic portion.

This provides greater discoverability of such hooks in search results on the Code Reference site as well as increased clarity when reading the source.

See #50734, #52628


git-svn-id: https://develop.svn.wordpress.org/trunk@50505 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2021-03-07 12:30:38 +00:00
parent c3be472657
commit fa05e5e733
26 changed files with 403 additions and 35 deletions

View File

@@ -290,7 +290,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible filter names include:
* Possible hook names include:
*
* - `rest_post_query`
* - `rest_page_query`
@@ -610,6 +610,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_insert_post`
* - `rest_insert_page`
* - `rest_insert_attachment`
*
* @since 4.7.0
*
* @param WP_Post $post Inserted or updated post object.
@@ -668,6 +674,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_after_insert_post`
* - `rest_after_insert_page`
* - `rest_after_insert_attachment`
*
* @since 5.0.0
*
* @param WP_Post $post Inserted or updated post object.
@@ -890,6 +902,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_post_trashable`
* - `rest_page_trashable`
* - `rest_attachment_trashable`
*
* Pass false to disable Trash support for the post.
*
* @since 4.7.0
@@ -1251,6 +1269,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_pre_insert_post`
* - `rest_pre_insert_page`
* - `rest_pre_insert_attachment`
*
* @since 4.7.0
*
* @param stdClass $prepared_post An object representing a single post prepared
@@ -1854,7 +1878,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible filter names include:
* Possible hook names include:
*
* - `rest_prepare_post`
* - `rest_prepare_page`

View File

@@ -237,6 +237,11 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_category_query`
* - `rest_post_tag_query`
*
* Enables adding extra arguments or setting defaults for a terms
* collection request.
*
@@ -475,6 +480,11 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_insert_category`
* - `rest_insert_post_tag`
*
* @since 4.7.0
*
* @param WP_Term $term Inserted or updated term object.
@@ -505,6 +515,11 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_after_insert_category`
* - `rest_after_insert_post_tag`
*
* @since 5.0.0
*
* @param WP_Term $term Inserted or updated term object.
@@ -702,6 +717,11 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_delete_category`
* - `rest_delete_post_tag`
*
* @since 4.7.0
*
* @param WP_Term $term The deleted term.
@@ -761,6 +781,11 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_pre_insert_category`
* - `rest_pre_insert_post_tag`
*
* @since 4.7.0
*
* @param object $prepared_term Term object.
@@ -832,7 +857,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible filter names include:
* Possible hook names include:
*
* - `rest_prepare_category`
* - `rest_prepare_post_tag`