mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 21:24:35 +00:00
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:
@@ -1772,6 +1772,12 @@ function get_post_type_labels( $post_type_object ) {
|
||||
* The dynamic portion of the hook name, `$post_type`, refers to
|
||||
* the post type slug.
|
||||
*
|
||||
* Possible hook names include:
|
||||
*
|
||||
* - `post_type_labels_post`
|
||||
* - `post_type_labels_page`
|
||||
* - `post_type_labels_attachment`
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @see get_post_type_labels() for the full list of labels.
|
||||
@@ -5031,6 +5037,23 @@ function wp_transition_post_status( $new_status, $old_status, $post ) {
|
||||
* The dynamic portions of the hook name, `$new_status` and `$post->post_type`,
|
||||
* refer to the new post status and post type, respectively.
|
||||
*
|
||||
* Possible hook names include:
|
||||
*
|
||||
* - `draft_post`
|
||||
* - `future_post`
|
||||
* - `pending_post`
|
||||
* - `private_post`
|
||||
* - `publish_post`
|
||||
* - `trash_post`
|
||||
* - `draft_page`
|
||||
* - `future_page`
|
||||
* - `pending_page`
|
||||
* - `private_page`
|
||||
* - `publish_page`
|
||||
* - `trash_page`
|
||||
* - `publish_attachment`
|
||||
* - `trash_attachment`
|
||||
*
|
||||
* Please note: When this action is hooked using a particular post status (like
|
||||
* 'publish', as `publish_{$post->post_type}`), it will fire both when a post is
|
||||
* first transitioned to that status from something else, as well as upon
|
||||
|
||||
Reference in New Issue
Block a user