Skip to content

Commit fa05e5e

Browse files
committed
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
1 parent c3be472 commit fa05e5e

26 files changed

Lines changed: 403 additions & 35 deletions

src/wp-admin/async-upload.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,14 @@
119119
/**
120120
* Filters the returned ID of an uploaded attachment.
121121
*
122-
* The dynamic portion of the hook name, `$type`, refers to the attachment type,
123-
* such as 'image', 'audio', 'video', 'file', etc.
122+
* The dynamic portion of the hook name, `$type`, refers to the attachment type.
123+
*
124+
* Possible hook names include:
125+
*
126+
* - `async_upload_audio`
127+
* - `async_upload_file`
128+
* - `async_upload_image`
129+
* - `async_upload_video`
124130
*
125131
* @since 2.5.0
126132
*

src/wp-admin/edit-tag-form.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
* The dynamic portion of the hook name, `$taxonomy`, refers to
6161
* the taxonomy slug.
6262
*
63+
* Possible hook names include:
64+
*
65+
* - `category_pre_edit_form`
66+
* - `post_tag_pre_edit_form`
67+
*
6368
* @since 3.0.0
6469
*
6570
* @param WP_Term $tag Current taxonomy term object.
@@ -96,6 +101,11 @@
96101
*
97102
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
98103
*
104+
* Possible hook names include:
105+
*
106+
* - `category_term_edit_form_tag`
107+
* - `post_tag_term_edit_form_tag`
108+
*
99109
* @since 3.7.0
100110
*/
101111
do_action( "{$taxonomy}_term_edit_form_tag" );
@@ -115,6 +125,11 @@
115125
*
116126
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
117127
*
128+
* Possible hook names include:
129+
*
130+
* - `category_term_edit_form_top`
131+
* - `post_tag_term_edit_form_top`
132+
*
118133
* @since 4.5.0
119134
*
120135
* @param WP_Term $tag Current taxonomy term object.
@@ -229,6 +244,11 @@
229244
* The dynamic portion of the hook name, `$taxonomy`, refers to
230245
* the taxonomy slug.
231246
*
247+
* Possible hook names include:
248+
*
249+
* - `category_edit_form_fields`
250+
* - `post_tag_edit_form_fields`
251+
*
232252
* @since 3.0.0
233253
*
234254
* @param WP_Term $tag Current taxonomy term object.
@@ -261,6 +281,11 @@
261281
*
262282
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
263283
*
284+
* Possible hook names include:
285+
*
286+
* - `category_edit_form`
287+
* - `post_tag_edit_form`
288+
*
264289
* @since 3.0.0
265290
*
266291
* @param WP_Term $tag Current taxonomy term object.

src/wp-admin/edit-tags.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@
414414
*
415415
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
416416
*
417+
* Possible hook names include:
418+
*
419+
* - `category_pre_add_form`
420+
* - `post_tag_pre_add_form`
421+
*
417422
* @since 3.0.0
418423
*
419424
* @param string $taxonomy The taxonomy slug.
@@ -430,6 +435,11 @@
430435
*
431436
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
432437
*
438+
* Possible hook names include:
439+
*
440+
* - `category_term_new_form_tag`
441+
* - `post_tag_term_new_form_tag`
442+
*
433443
* @since 3.7.0
434444
*/
435445
do_action( "{$taxonomy}_term_new_form_tag" );
@@ -522,6 +532,11 @@
522532
*
523533
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
524534
*
535+
* Possible hook names include:
536+
*
537+
* - `category_add_form_fields`
538+
* - `post_tag_add_form_fields`
539+
*
525540
* @since 3.0.0
526541
*
527542
* @param string $taxonomy The taxonomy slug.
@@ -570,6 +585,11 @@
570585
*
571586
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
572587
*
588+
* Possible hook names include:
589+
*
590+
* - `category_add_form`
591+
* - `post_tag_add_form`
592+
*
573593
* @since 3.0.0
574594
*
575595
* @param string $taxonomy The taxonomy slug.
@@ -638,6 +658,11 @@
638658
*
639659
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
640660
*
661+
* Possible hook names include:
662+
*
663+
* - `after-category-table`
664+
* - `after-post_tag-table`
665+
*
641666
* @since 3.0.0
642667
*
643668
* @param string $taxonomy The taxonomy name.

src/wp-admin/includes/class-wp-automatic-updater.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ public function should_update( $type, $item, $context ) {
182182
* Filters whether to automatically update core, a plugin, a theme, or a language.
183183
*
184184
* The dynamic portion of the hook name, `$type`, refers to the type of update
185-
* being checked. Potential hook names include:
185+
* being checked.
186+
*
187+
* Possible hook names include:
186188
*
187189
* - `auto_update_core`
188190
* - `auto_update_plugin`

src/wp-admin/includes/class-wp-plugin-install-list-table.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,14 @@ public function prepare_items() {
213213
* Filters API request arguments for each Add Plugins screen tab.
214214
*
215215
* The dynamic portion of the hook name, `$tab`, refers to the plugin install tabs.
216-
* Default tabs include 'featured', 'popular', 'recommended', 'favorites', and 'upload'.
216+
*
217+
* Possible hook names include:
218+
*
219+
* - `install_plugins_table_api_args_favorites`
220+
* - `install_plugins_table_api_args_featured`
221+
* - `install_plugins_table_api_args_popular`
222+
* - `install_plugins_table_api_args_recommended`
223+
* - `install_plugins_table_api_args_upload`
217224
*
218225
* @since 3.7.0
219226
*

src/wp-admin/includes/class-wp-posts-list-table.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,11 @@ public function get_columns() {
632632
* The dynamic portion of the hook name, `$post_type`, refers to the post
633633
* type slug.
634634
*
635+
* Possible hook names include:
636+
*
637+
* - `manage_taxonomies_for_post_columns`
638+
* - `manage_taxonomies_for_page_columns`
639+
*
635640
* @since 3.5.0
636641
*
637642
* @param string[] $taxonomies Array of taxonomy names to show columns for.
@@ -687,6 +692,11 @@ public function get_columns() {
687692
*
688693
* The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
689694
*
695+
* Possible hook names include:
696+
*
697+
* - `manage_post_posts_columns`
698+
* - `manage_page_posts_columns`
699+
*
690700
* @since 3.0.0
691701
*
692702
* @param string[] $post_columns An associative array of column headings.
@@ -1274,6 +1284,11 @@ public function column_default( $post, $column_name ) {
12741284
*
12751285
* The dynamic portion of the hook name, `$post->post_type`, refers to the post type.
12761286
*
1287+
* Possible hook names include:
1288+
*
1289+
* - `manage_post_posts_custom_column`
1290+
* - `manage_page_posts_custom_column`
1291+
*
12771292
* @since 3.1.0
12781293
*
12791294
* @param string $column_name The name of the column to display.

src/wp-admin/includes/class-wp-terms-list-table.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,11 @@ protected function handle_row_actions( $tag, $column_name, $primary ) {
526526
*
527527
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
528528
*
529+
* Possible hook names include:
530+
*
531+
* - `category_row_actions`
532+
* - `post_tag_row_actions`
533+
*
529534
* @since 3.0.0
530535
*
531536
* @param string[] $actions An array of action links to be displayed. Default
@@ -616,6 +621,11 @@ public function column_default( $tag, $column_name ) {
616621
* The dynamic portion of the hook name, `$this->screen->taxonomy`,
617622
* refers to the slug of the current taxonomy.
618623
*
624+
* Possible hook names include:
625+
*
626+
* - `manage_category_custom_column`
627+
* - `manage_post_tag_custom_column`
628+
*
619629
* @since 2.8.0
620630
*
621631
* @param string $string Blank string.

src/wp-admin/includes/class-wp-theme-install-list-table.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,16 @@ public function prepare_items() {
132132
* Filters API request arguments for each Install Themes screen tab.
133133
*
134134
* The dynamic portion of the hook name, `$tab`, refers to the theme install
135-
* tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',
136-
* 'new', and 'updated'.
135+
* tab.
136+
*
137+
* Possible hook names include:
138+
*
139+
* - `install_themes_table_api_args_dashboard`
140+
* - `install_themes_table_api_args_featured`
141+
* - `install_themes_table_api_args_new`
142+
* - `install_themes_table_api_args_search`
143+
* - `install_themes_table_api_args_updated`
144+
* - `install_themes_table_api_args_upload`
137145
*
138146
* @since 3.7.0
139147
*

src/wp-admin/includes/file.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,8 @@ function wp_handle_upload_error( &$file, $message ) {
757757
* Filters the data for a file before it is uploaded to WordPress.
758758
*
759759
* The dynamic portion of the hook name, `$action`, refers to the post action.
760-
* Possible filter names include:
760+
*
761+
* Possible hook names include:
761762
*
762763
* - `wp_handle_sideload_prefilter`
763764
* - `wp_handle_upload_prefilter`
@@ -773,7 +774,8 @@ function wp_handle_upload_error( &$file, $message ) {
773774
* Filters the override parameters for a file before it is uploaded to WordPress.
774775
*
775776
* The dynamic portion of the hook name, `$action`, refers to the post action.
776-
* Possible filter names include:
777+
*
778+
* Possible hook names include:
777779
*
778780
* - `wp_handle_sideload_overrides`
779781
* - `wp_handle_upload_overrides`

src/wp-admin/includes/media.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,14 @@ function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
696696
* The dynamic portion of the hook name, `$type`, refers to the type
697697
* of media uploaded.
698698
*
699+
* Possible hook names include:
700+
*
701+
* - `image_upload_iframe_src`
702+
* - `media_upload_iframe_src`
703+
*
699704
* @since 3.0.0
700705
*
701-
* @param string $upload_iframe_src The upload iframe source URL by type.
706+
* @param string $upload_iframe_src The upload iframe source URL.
702707
*/
703708
$upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
704709

@@ -893,6 +898,12 @@ function wp_media_upload_handler() {
893898
* The dynamic portion of the hook name, `$type`, refers to the type
894899
* of media being sent.
895900
*
901+
* Possible hook names include:
902+
*
903+
* - `audio_send_to_editor_url`
904+
* - `file_send_to_editor_url`
905+
* - `video_send_to_editor_url`
906+
*
896907
* @since 3.3.0
897908
*
898909
* @param string $html HTML markup sent to the editor.

0 commit comments

Comments
 (0)