From 77c58c527c2efd6784dff34715c069d9b87638a4 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Tue, 8 Oct 2019 03:58:38 +0200
Subject: [PATCH] Deprecated hooks: improve documentation
Let the docs link to the replacement when available.
---
src/wp-admin/edit-tag-form.php | 14 +++++++-------
src/wp-admin/edit-tags.php | 12 ++++++------
src/wp-admin/includes/class-wp-screen.php | 12 ++++++------
.../includes/class-wp-terms-list-table.php | 4 ++--
src/wp-admin/includes/image-edit.php | 6 +++---
src/wp-admin/includes/meta-boxes.php | 2 +-
src/wp-includes/capabilities.php | 5 +++--
src/wp-includes/class-wp-rewrite.php | 4 ++--
src/wp-includes/class-wp.php | 2 +-
src/wp-includes/ms-blogs.php | 2 +-
src/wp-includes/ms-site.php | 4 ++--
src/wp-includes/post.php | 2 +-
src/wp-includes/rest-api/class-wp-rest-server.php | 3 ++-
src/wp-includes/taxonomy.php | 4 ++--
src/wp-includes/user.php | 2 +-
src/wp-login.php | 2 +-
16 files changed, 41 insertions(+), 39 deletions(-)
diff --git a/src/wp-admin/edit-tag-form.php b/src/wp-admin/edit-tag-form.php
index cf5c80ffa2..a56ee93ff7 100644
a
|
b
|
if ( 'category' == $taxonomy ) { |
17 | 17 | * Fires before the Edit Category form. |
18 | 18 | * |
19 | 19 | * @since 2.1.0 |
20 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead. |
| 20 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. |
21 | 21 | * |
22 | 22 | * @param WP_Term $tag Current category term object. |
23 | 23 | */ |
… |
… |
if ( 'category' == $taxonomy ) { |
27 | 27 | * Fires before the Edit Link Category form. |
28 | 28 | * |
29 | 29 | * @since 2.3.0 |
30 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead. |
| 30 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. |
31 | 31 | * |
32 | 32 | * @param WP_Term $tag Current link category term object. |
33 | 33 | */ |
… |
… |
if ( 'category' == $taxonomy ) { |
37 | 37 | * Fires before the Edit Tag form. |
38 | 38 | * |
39 | 39 | * @since 2.5.0 |
40 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_edit_form instead. |
| 40 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. |
41 | 41 | * |
42 | 42 | * @param WP_Term $tag Current tag term object. |
43 | 43 | */ |
… |
… |
if ( isset( $tag->name ) ) { |
197 | 197 | * Fires after the Edit Category form fields are displayed. |
198 | 198 | * |
199 | 199 | * @since 2.9.0 |
200 | | * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead. |
| 200 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. |
201 | 201 | * |
202 | 202 | * @param WP_Term $tag Current category term object. |
203 | 203 | */ |
… |
… |
if ( isset( $tag->name ) ) { |
207 | 207 | * Fires after the Edit Link Category form fields are displayed. |
208 | 208 | * |
209 | 209 | * @since 2.9.0 |
210 | | * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead. |
| 210 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. |
211 | 211 | * |
212 | 212 | * @param WP_Term $tag Current link category term object. |
213 | 213 | */ |
… |
… |
if ( isset( $tag->name ) ) { |
217 | 217 | * Fires after the Edit Tag form fields are displayed. |
218 | 218 | * |
219 | 219 | * @since 2.9.0 |
220 | | * @deprecated 3.0.0 Use {$taxonomy}_edit_form_fields instead. |
| 220 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. |
221 | 221 | * |
222 | 222 | * @param WP_Term $tag Current tag term object. |
223 | 223 | */ |
… |
… |
if ( 'category' == $taxonomy ) { |
250 | 250 | * Fires at the end of the Edit Term form. |
251 | 251 | * |
252 | 252 | * @since 2.5.0 |
253 | | * @deprecated 3.0.0 Use {$taxonomy}_edit_form instead. |
| 253 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form'} instead. |
254 | 254 | * |
255 | 255 | * @param WP_Term $tag Current taxonomy term object. |
256 | 256 | */ |
diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php
index d2cda2c633..93d5b73258 100644
a
|
b
|
if ( $can_edit_terms ) { |
374 | 374 | * Fires before the Add Category form. |
375 | 375 | * |
376 | 376 | * @since 2.1.0 |
377 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. |
| 377 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead. |
378 | 378 | * |
379 | 379 | * @param object $arg Optional arguments cast to an object. |
380 | 380 | */ |
… |
… |
if ( $can_edit_terms ) { |
384 | 384 | * Fires before the link category form. |
385 | 385 | * |
386 | 386 | * @since 2.3.0 |
387 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. |
| 387 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead. |
388 | 388 | * |
389 | 389 | * @param object $arg Optional arguments cast to an object. |
390 | 390 | */ |
… |
… |
if ( $can_edit_terms ) { |
394 | 394 | * Fires before the Add Tag form. |
395 | 395 | * |
396 | 396 | * @since 2.5.0 |
397 | | * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead. |
| 397 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead. |
398 | 398 | * |
399 | 399 | * @param string $taxonomy The taxonomy slug. |
400 | 400 | */ |
… |
… |
if ( $can_edit_terms ) { |
530 | 530 | * Fires at the end of the Edit Category form. |
531 | 531 | * |
532 | 532 | * @since 2.1.0 |
533 | | * @deprecated 3.0.0 Use {$taxonomy}_add_form instead. |
| 533 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead. |
534 | 534 | * |
535 | 535 | * @param object $arg Optional arguments cast to an object. |
536 | 536 | */ |
… |
… |
if ( $can_edit_terms ) { |
540 | 540 | * Fires at the end of the Edit Link form. |
541 | 541 | * |
542 | 542 | * @since 2.3.0 |
543 | | * @deprecated 3.0.0 Use {$taxonomy}_add_form instead. |
| 543 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead. |
544 | 544 | * |
545 | 545 | * @param object $arg Optional arguments cast to an object. |
546 | 546 | */ |
… |
… |
if ( $can_edit_terms ) { |
550 | 550 | * Fires at the end of the Add Tag form. |
551 | 551 | * |
552 | 552 | * @since 2.7.0 |
553 | | * @deprecated 3.0.0 Use {$taxonomy}_add_form instead. |
| 553 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead. |
554 | 554 | * |
555 | 555 | * @param string $taxonomy The taxonomy slug. |
556 | 556 | */ |
diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
index 8d9a4fa072..5f59254535 100644
a
|
b
|
final class WP_Screen { |
769 | 769 | * Filters the legacy contextual help list. |
770 | 770 | * |
771 | 771 | * @since 2.7.0 |
772 | | * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or |
773 | | * get_current_screen()->remove_help_tab() instead. |
| 772 | * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or |
| 773 | * {@see get_current_screen()->remove_help_tab()} instead. |
774 | 774 | * |
775 | 775 | * @param array $old_compat_help Old contextual help. |
776 | 776 | * @param WP_Screen $this Current WP_Screen instance. |
… |
… |
final class WP_Screen { |
788 | 788 | * Filters the legacy contextual help text. |
789 | 789 | * |
790 | 790 | * @since 2.7.0 |
791 | | * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or |
792 | | * get_current_screen()->remove_help_tab() instead. |
| 791 | * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or |
| 792 | * {@see get_current_screen()->remove_help_tab()} instead. |
793 | 793 | * |
794 | 794 | * @param string $old_help Help text that appears on the screen. |
795 | 795 | * @param string $screen_id Screen ID. |
… |
… |
final class WP_Screen { |
809 | 809 | * Filters the default legacy contextual help text. |
810 | 810 | * |
811 | 811 | * @since 2.8.0 |
812 | | * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or |
813 | | * get_current_screen()->remove_help_tab() instead. |
| 812 | * @deprecated 3.3.0 Use {@see get_current_screen()->add_help_tab()} or |
| 813 | * {@see get_current_screen()->remove_help_tab()} instead. |
814 | 814 | * |
815 | 815 | * @param string $old_help_default Default contextual help text. |
816 | 816 | */ |
diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php
index a537311d40..125d3366b5 100644
a
|
b
|
class WP_Terms_List_Table extends WP_List_Table { |
93 | 93 | * Filters the number of terms displayed per page for the Tags list table. |
94 | 94 | * |
95 | 95 | * @since 2.7.0 |
96 | | * @deprecated 2.8.0 Use edit_tags_per_page instead. |
| 96 | * @deprecated 2.8.0 Use {@see 'edit_tags_per_page'} instead. |
97 | 97 | * |
98 | 98 | * @param int $tags_per_page Number of tags to be displayed. Default 20. |
99 | 99 | */ |
… |
… |
class WP_Terms_List_Table extends WP_List_Table { |
502 | 502 | * Filters the action links displayed for each term in the Tags list table. |
503 | 503 | * |
504 | 504 | * @since 2.8.0 |
505 | | * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead. |
| 505 | * @deprecated 3.0.0 Use {@see '{$taxonomy}_row_actions'} instead. |
506 | 506 | * |
507 | 507 | * @param string[] $actions An array of action links to be displayed. Default |
508 | 508 | * 'Edit', 'Quick Edit', 'Delete', and 'View'. |
diff --git a/src/wp-admin/includes/image-edit.php b/src/wp-admin/includes/image-edit.php
index 519100acc3..02ab041840 100644
a
|
b
|
function wp_stream_image( $image, $mime_type, $attachment_id ) { |
287 | 287 | * Filters the GD image resource to be streamed to the browser. |
288 | 288 | * |
289 | 289 | * @since 2.9.0 |
290 | | * @deprecated 3.5.0 Use image_editor_save_pre instead. |
| 290 | * @deprecated 3.5.0 Use {@see 'image_editor_save_pre'} instead. |
291 | 291 | * |
292 | 292 | * @param resource $image Image resource to be streamed. |
293 | 293 | * @param int $attachment_id The attachment post ID. |
… |
… |
function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { |
362 | 362 | * returning that value instead. |
363 | 363 | * |
364 | 364 | * @since 2.9.0 |
365 | | * @deprecated 3.5.0 Use wp_save_image_editor_file instead. |
| 365 | * @deprecated 3.5.0 Use {@see 'wp_save_image_editor_file'} instead. |
366 | 366 | * |
367 | 367 | * @param mixed $override Value to return instead of saving. Default null. |
368 | 368 | * @param string $filename Name of the file to be saved. |
… |
… |
function image_edit_apply_changes( $image, $changes ) { |
565 | 565 | * Filters the GD image resource before applying changes to the image. |
566 | 566 | * |
567 | 567 | * @since 2.9.0 |
568 | | * @deprecated 3.5.0 Use wp_image_editor_before_change instead. |
| 568 | * @deprecated 3.5.0 Use {@see 'wp_image_editor_before_change'} instead. |
569 | 569 | * |
570 | 570 | * @param resource $image GD image resource. |
571 | 571 | * @param array $changes Array of change operations. |
diff --git a/src/wp-admin/includes/meta-boxes.php b/src/wp-admin/includes/meta-boxes.php
index 4cf7378501..ae246f8b76 100644
a
|
b
|
function register_and_do_post_meta_boxes( $post ) { |
1504 | 1504 | * Fires in the middle of built-in meta box registration. |
1505 | 1505 | * |
1506 | 1506 | * @since 2.1.0 |
1507 | | * @deprecated 3.7.0 Use 'add_meta_boxes' instead. |
| 1507 | * @deprecated 3.7.0 Use {@see 'add_meta_boxes'} instead. |
1508 | 1508 | * |
1509 | 1509 | * @param WP_Post $post Post object. |
1510 | 1510 | */ |
diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php
index e3a18f6b28..2276c5b82b 100644
a
|
b
|
function map_meta_cap( $cap, $user_id, ...$args ) { |
352 | 352 | * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap(). |
353 | 353 | * |
354 | 354 | * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`. |
355 | | * @since 4.7.0 |
356 | | * @deprecated 4.9.8 Use `auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}` |
| 355 | * @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to |
| 356 | * `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`. |
| 357 | * @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead. |
357 | 358 | * |
358 | 359 | * @param bool $allowed Whether the user can add the object meta. Default false. |
359 | 360 | * @param string $meta_key The meta key. |
diff --git a/src/wp-includes/class-wp-rewrite.php b/src/wp-includes/class-wp-rewrite.php
index f73617e066..c630a03612 100644
a
|
b
|
class WP_Rewrite { |
1407 | 1407 | * Filters rewrite rules used specifically for Tags. |
1408 | 1408 | * |
1409 | 1409 | * @since 2.3.0 |
1410 | | * @deprecated 3.1.0 Use 'post_tag_rewrite_rules' instead |
| 1410 | * @deprecated 3.1.0 Use {@see 'post_tag_rewrite_rules'} instead. |
1411 | 1411 | * |
1412 | 1412 | * @param array $rules The rewrite rules generated for tags. |
1413 | 1413 | */ |
… |
… |
class WP_Rewrite { |
1556 | 1556 | * Filters the list of rewrite rules formatted for output to an .htaccess file. |
1557 | 1557 | * |
1558 | 1558 | * @since 1.5.0 |
1559 | | * @deprecated 1.5.0 Use the mod_rewrite_rules filter instead. |
| 1559 | * @deprecated 1.5.0 Use the {@see 'mod_rewrite_rules'} filter instead. |
1560 | 1560 | * |
1561 | 1561 | * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess. |
1562 | 1562 | */ |
diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php
index 0772426773..db419be7f3 100644
a
|
b
|
class WP { |
542 | 542 | * Filters the query string before parsing. |
543 | 543 | * |
544 | 544 | * @since 1.5.0 |
545 | | * @deprecated 2.1.0 Use 'query_vars' or 'request' filters instead. |
| 545 | * @deprecated 2.1.0 Use {@see 'query_vars'} or {@see 'request'} filters instead. |
546 | 546 | * |
547 | 547 | * @param string $query_string The query string to modify. |
548 | 548 | */ |
diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php
index 2874f7e1f0..ef7eeb1b24 100644
a
|
b
|
function get_blog_details( $fields = null, $get_all = true ) { |
249 | 249 | * Filters a blog's details. |
250 | 250 | * |
251 | 251 | * @since MU (3.0.0) |
252 | | * @deprecated 4.7.0 Use site_details |
| 252 | * @deprecated 4.7.0 Use {@see 'site_details'} instead. |
253 | 253 | * |
254 | 254 | * @param object $details The blog details. |
255 | 255 | */ |
diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php
index b98e17eaa4..729ecb9714 100644
a
|
b
|
function wp_insert_site( array $data ) { |
121 | 121 | * Fires immediately after a new site is created. |
122 | 122 | * |
123 | 123 | * @since MU (3.0.0) |
124 | | * @deprecated 5.1.0 Use wp_insert_site |
| 124 | * @deprecated 5.1.0 Use {@see 'wp_insert_site'} instead. |
125 | 125 | * |
126 | 126 | * @param int $site_id Site ID. |
127 | 127 | * @param int $user_id User ID. |
… |
… |
function clean_blog_cache( $blog ) { |
1026 | 1026 | * Fires after the blog details cache is cleared. |
1027 | 1027 | * |
1028 | 1028 | * @since 3.4.0 |
1029 | | * @deprecated 4.9.0 Use clean_site_cache |
| 1029 | * @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead. |
1030 | 1030 | * |
1031 | 1031 | * @param int $blog_id Blog ID. |
1032 | 1032 | */ |
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 2a598fc2fb..4982b62ab1 100644
a
|
b
|
function _transition_post_status( $new_status, $old_status, $post ) { |
6730 | 6730 | * Fires when a post's status is transitioned from private to published. |
6731 | 6731 | * |
6732 | 6732 | * @since 1.5.0 |
6733 | | * @deprecated 2.3.0 Use 'private_to_publish' instead. |
| 6733 | * @deprecated 2.3.0 Use {@see 'private_to_publish'} instead. |
6734 | 6734 | * |
6735 | 6735 | * @param int $post_id Post ID. |
6736 | 6736 | */ |
diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php
index 8b09076da0..40c350ad4e 100644
a
|
b
|
class WP_REST_Server { |
260 | 260 | * Filters whether the REST API is enabled. |
261 | 261 | * |
262 | 262 | * @since 4.4.0 |
263 | | * @deprecated 4.7.0 Use the rest_authentication_errors filter to restrict access to the API |
| 263 | * @deprecated 4.7.0 Use the {@see 'rest_authentication_errors'} filter to |
| 264 | * restrict access to the API. |
264 | 265 | * |
265 | 266 | * @param bool $rest_enabled Whether the REST API is enabled. Default true. |
266 | 267 | */ |
diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index e861d921f5..f288130a95 100644
a
|
b
|
function get_term_link( $term, $taxonomy = '' ) { |
4244 | 4244 | * Filters the tag link. |
4245 | 4245 | * |
4246 | 4246 | * @since 2.3.0 |
4247 | | * @deprecated 2.5.0 Use 'term_link' instead. |
| 4247 | * @deprecated 2.5.0 Use {@see 'term_link'} instead. |
4248 | 4248 | * |
4249 | 4249 | * @param string $termlink Tag link URL. |
4250 | 4250 | * @param int $term_id Term ID. |
… |
… |
function get_term_link( $term, $taxonomy = '' ) { |
4256 | 4256 | * Filters the category link. |
4257 | 4257 | * |
4258 | 4258 | * @since 1.5.0 |
4259 | | * @deprecated 2.5.0 Use 'term_link' instead. |
| 4259 | * @deprecated 2.5.0 Use {@see 'term_link'} instead. |
4260 | 4260 | * |
4261 | 4261 | * @param string $termlink Category link URL. |
4262 | 4262 | * @param int $term_id Term ID. |
diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
index 6c3a5fe85d..0f91f08507 100644
a
|
b
|
function get_password_reset_key( $user ) { |
2268 | 2268 | * Use the {@see 'retrieve_password'} hook instead. |
2269 | 2269 | * |
2270 | 2270 | * @since 1.5.0 |
2271 | | * @deprecated 1.5.1 Misspelled. Use 'retrieve_password' hook instead. |
| 2271 | * @deprecated 1.5.1 Misspelled. Use {@see 'retrieve_password'} hook instead. |
2272 | 2272 | * |
2273 | 2273 | * @param string $user_login The user login name. |
2274 | 2274 | */ |
diff --git a/src/wp-login.php b/src/wp-login.php
index 04e546ea64..fa66f2e307 100644
a
|
b
|
function login_header( $title = 'Log In', $message = '', $wp_error = null ) { |
135 | 135 | * Filters the title attribute of the header logo above login form. |
136 | 136 | * |
137 | 137 | * @since 2.1.0 |
138 | | * @deprecated 5.2.0 Use login_headertext |
| 138 | * @deprecated 5.2.0 Use {@see 'login_headertext'} instead. |
139 | 139 | * |
140 | 140 | * @param string $login_header_title Login header logo title attribute. |
141 | 141 | */ |