Docs: Add and correct examples of common names for various dynamic hooks.

See #53581

Built from https://develop.svn.wordpress.org/trunk@51327


git-svn-id: http://core.svn.wordpress.org/trunk@50936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2021-07-03 21:42:59 +00:00
parent 6b78871b4a
commit efaf4a8938
11 changed files with 72 additions and 7 deletions

View File

@ -320,6 +320,16 @@ if ( isset( $plugin_page ) ) {
*
* The dynamic portion of the hook name, `$importer`, refers to the importer slug.
*
* Possible hook names include:
*
* - `load-importer-blogger`
* - `load-importer-wpcat2tag`
* - `load-importer-livejournal`
* - `load-importer-mt`
* - `load-importer-rss`
* - `load-importer-tumblr`
* - `load-importer-wordpress`
*
* @since 3.5.0
*/
do_action( "load-importer-{$importer}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

View File

@ -578,9 +578,7 @@ function wp_iframe( $content_func, ...$args ) {
* (pre-3.5.0) media upload popup.
*
* The dynamic portion of the hook, `$content_func`, refers to the form
* callback for the media upload type. Possible values include
* 'media_upload_type_form', 'media_upload_type_url_form', and
* 'media_upload_library_form'.
* callback for the media upload type.
*
* @since 2.5.0
*/

View File

@ -1582,6 +1582,12 @@ function register_and_do_post_meta_boxes( $post ) {
*
* The dynamic portion of the hook, `$post_type`, refers to the post type of the post.
*
* Possible hook names include:
*
* - `add_meta_boxes_post`
* - `add_meta_boxes_page`
* - `add_meta_boxes_attachment`
*
* @since 3.0.0
*
* @param WP_Post $post Post object.

View File

@ -1346,6 +1346,12 @@ function get_the_term_list( $post_id, $taxonomy, $before = '', $sep = '', $after
* The dynamic portion of the filter name, `$taxonomy`, refers
* to the taxonomy slug.
*
* Possible hook names include:
*
* - `term_links-category`
* - `term_links-post_tag`
* - `term_links-post_format`
*
* @since 2.5.0
*
* @param string[] $links An array of term links.

View File

@ -1411,8 +1411,13 @@ class WP_Rewrite {
* Filters rewrite rules used for individual permastructs.
*
* The dynamic portion of the hook name, `$permastructname`, refers
* to the name of the registered permastruct, e.g. 'post_tag' (tags),
* 'category' (categories), etc.
* to the name of the registered permastruct.
*
* Possible hook names include:
*
* - `category_rewrite_rules`
* - `post_format_rewrite_rules`
* - `post_tag_rewrite_rules`
*
* @since 3.1.0
*

View File

@ -2647,7 +2647,15 @@ function comment_form( $args = array(), $post_id = null ) {
* Filters a comment form field for display.
*
* The dynamic portion of the filter hook, `$name`, refers to the name
* of the comment form field. Such as 'author', 'email', or 'url'.
* of the comment form field.
*
* Possible hook names include:
*
* - `comment_form_field_comment`
* - `comment_form_field_author`
* - `comment_form_field_email`
* - `comment_form_field_url`
* - `comment_form_field_cookies`
*
* @since 3.0.0
*

View File

@ -4411,6 +4411,11 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
* The dynamic portion of the hook name, `$post->post_type`, refers to
* the post type slug.
*
* Possible hook names include:
*
* - `edit_post_post`
* - `edit_post_page`
*
* @since 5.1.0
*
* @param int $post_ID Post ID.
@ -4448,6 +4453,11 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
* The dynamic portion of the hook name, `$post->post_type`, refers to
* the post type slug.
*
* Possible hook names include:
*
* - `save_post_post`
* - `save_post_page`
*
* @since 3.7.0
*
* @param int $post_ID Post ID.

View File

@ -1024,6 +1024,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
*
* They dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_delete_post`
* - `rest_delete_page`
* - `rest_delete_attachment`
*
* @since 4.7.0
*
* @param WP_Post $post The deleted or trashed post.
@ -2534,6 +2540,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
* The dynamic portion of the filter, `$this->post_type`, refers to the
* post type slug for the controller.
*
* Possible hook names include:
*
* - `rest_post_item_schema`
* - `rest_page_item_schema`
* - `rest_attachment_item_schema`
*
* @since 5.4.0
*
* @param array $schema Item schema data.

View File

@ -574,6 +574,11 @@ function wp_revisions_to_keep( $post ) {
* The dynamic portion of the hook name, `$post->post_type`, refers to
* the post type slug.
*
* Possible hook names include:
*
* - `wp_post_revisions_to_keep`
* - `wp_page_revisions_to_keep`
*
* @since 5.8.0
*
* @param int $num Number of revisions to store.

View File

@ -948,6 +948,11 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
* The dynamic portion of the filter name, `$taxonomy`, refers
* to the slug of the term's taxonomy.
*
* Possible hook names include:
*
* - `get_category`
* - `get_post_tag`
*
* @since 2.3.0
* @since 4.4.0 `$_term` is now a `WP_Term` object.
*

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51326';
$wp_version = '5.9-alpha-51327';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.