Make WordPress Core

Ticket #48255: 48255-deprecated-hooks-improve-documentation.patch

File 48255-deprecated-hooks-improve-documentation.patch, 17.3 KB (added by jrf, 5 years ago)

Deprecated hooks: improve documentation Let the docs link to the replacement when available.

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

    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 ) { 
    1717         * Fires before the Edit Category form.
    1818         *
    1919         * @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.
    2121         *
    2222         * @param WP_Term $tag Current category term object.
    2323         */
    if ( 'category' == $taxonomy ) { 
    2727         * Fires before the Edit Link Category form.
    2828         *
    2929         * @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.
    3131         *
    3232         * @param WP_Term $tag Current link category term object.
    3333         */
    if ( 'category' == $taxonomy ) { 
    3737         * Fires before the Edit Tag form.
    3838         *
    3939         * @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.
    4141         *
    4242         * @param WP_Term $tag Current tag term object.
    4343         */
    if ( isset( $tag->name ) ) { 
    197197                         * Fires after the Edit Category form fields are displayed.
    198198                         *
    199199                         * @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.
    201201                         *
    202202                         * @param WP_Term $tag Current category term object.
    203203                         */
    if ( isset( $tag->name ) ) { 
    207207                         * Fires after the Edit Link Category form fields are displayed.
    208208                         *
    209209                         * @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.
    211211                         *
    212212                         * @param WP_Term $tag Current link category term object.
    213213                         */
    if ( isset( $tag->name ) ) { 
    217217                         * Fires after the Edit Tag form fields are displayed.
    218218                         *
    219219                         * @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.
    221221                         *
    222222                         * @param WP_Term $tag Current tag term object.
    223223                         */
    if ( 'category' == $taxonomy ) { 
    250250         * Fires at the end of the Edit Term form.
    251251         *
    252252         * @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.
    254254         *
    255255         * @param WP_Term $tag Current taxonomy term object.
    256256         */
  • src/wp-admin/edit-tags.php

    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 ) { 
    374374                 * Fires before the Add Category form.
    375375                 *
    376376                 * @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.
    378378                 *
    379379                 * @param object $arg Optional arguments cast to an object.
    380380                 */
    if ( $can_edit_terms ) { 
    384384                 * Fires before the link category form.
    385385                 *
    386386                 * @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.
    388388                 *
    389389                 * @param object $arg Optional arguments cast to an object.
    390390                 */
    if ( $can_edit_terms ) { 
    394394                 * Fires before the Add Tag form.
    395395                 *
    396396                 * @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.
    398398                 *
    399399                 * @param string $taxonomy The taxonomy slug.
    400400                 */
    if ( $can_edit_terms ) { 
    530530                 * Fires at the end of the Edit Category form.
    531531                 *
    532532                 * @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.
    534534                 *
    535535                 * @param object $arg Optional arguments cast to an object.
    536536                 */
    if ( $can_edit_terms ) { 
    540540                 * Fires at the end of the Edit Link form.
    541541                 *
    542542                 * @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.
    544544                 *
    545545                 * @param object $arg Optional arguments cast to an object.
    546546                 */
    if ( $can_edit_terms ) { 
    550550                 * Fires at the end of the Add Tag form.
    551551                 *
    552552                 * @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.
    554554                 *
    555555                 * @param string $taxonomy The taxonomy slug.
    556556                 */
  • src/wp-admin/includes/class-wp-screen.php

    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 { 
    769769                 * Filters the legacy contextual help list.
    770770                 *
    771771                 * @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.
    774774                 *
    775775                 * @param array     $old_compat_help Old contextual help.
    776776                 * @param WP_Screen $this            Current WP_Screen instance.
    final class WP_Screen { 
    788788                 * Filters the legacy contextual help text.
    789789                 *
    790790                 * @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.
    793793                 *
    794794                 * @param string    $old_help  Help text that appears on the screen.
    795795                 * @param string    $screen_id Screen ID.
    final class WP_Screen { 
    809809                         * Filters the default legacy contextual help text.
    810810                         *
    811811                         * @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.
    814814                         *
    815815                         * @param string $old_help_default Default contextual help text.
    816816                         */
  • src/wp-admin/includes/class-wp-terms-list-table.php

    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 { 
    9393                         * Filters the number of terms displayed per page for the Tags list table.
    9494                         *
    9595                         * @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.
    9797                         *
    9898                         * @param int $tags_per_page Number of tags to be displayed. Default 20.
    9999                         */
    class WP_Terms_List_Table extends WP_List_Table { 
    502502                 * Filters the action links displayed for each term in the Tags list table.
    503503                 *
    504504                 * @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.
    506506                 *
    507507                 * @param string[] $actions An array of action links to be displayed. Default
    508508                 *                          'Edit', 'Quick Edit', 'Delete', and 'View'.
  • src/wp-admin/includes/image-edit.php

    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 ) { 
    287287                 * Filters the GD image resource to be streamed to the browser.
    288288                 *
    289289                 * @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.
    291291                 *
    292292                 * @param resource $image         Image resource to be streamed.
    293293                 * @param int      $attachment_id The attachment post ID.
    function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { 
    362362                 * returning that value instead.
    363363                 *
    364364                 * @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.
    366366                 *
    367367                 * @param mixed           $override  Value to return instead of saving. Default null.
    368368                 * @param string          $filename  Name of the file to be saved.
    function image_edit_apply_changes( $image, $changes ) { 
    565565                 * Filters the GD image resource before applying changes to the image.
    566566                 *
    567567                 * @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.
    569569                 *
    570570                 * @param resource $image   GD image resource.
    571571                 * @param array    $changes Array of change operations.
  • src/wp-admin/includes/meta-boxes.php

    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 ) { 
    15041504         * Fires in the middle of built-in meta box registration.
    15051505         *
    15061506         * @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.
    15081508         *
    15091509         * @param WP_Post $post Post object.
    15101510         */
  • src/wp-includes/capabilities.php

    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 ) { 
    352352                                         * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().
    353353                                         *
    354354                                         * @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.
    357358                                         *
    358359                                         * @param bool     $allowed   Whether the user can add the object meta. Default false.
    359360                                         * @param string   $meta_key  The meta key.
  • src/wp-includes/class-wp-rewrite.php

    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 { 
    14071407                                 * Filters rewrite rules used specifically for Tags.
    14081408                                 *
    14091409                                 * @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.
    14111411                                 *
    14121412                                 * @param array $rules The rewrite rules generated for tags.
    14131413                                 */
    class WP_Rewrite { 
    15561556                 * Filters the list of rewrite rules formatted for output to an .htaccess file.
    15571557                 *
    15581558                 * @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.
    15601560                 *
    15611561                 * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess.
    15621562                 */
  • src/wp-includes/class-wp.php

    diff --git a/src/wp-includes/class-wp.php b/src/wp-includes/class-wp.php
    index 0772426773..db419be7f3 100644
    a b class WP { 
    542542                         * Filters the query string before parsing.
    543543                         *
    544544                         * @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.
    546546                         *
    547547                         * @param string $query_string The query string to modify.
    548548                         */
  • src/wp-includes/ms-blogs.php

    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 ) { 
    249249         * Filters a blog's details.
    250250         *
    251251         * @since MU (3.0.0)
    252          * @deprecated 4.7.0 Use site_details
     252         * @deprecated 4.7.0 Use {@see 'site_details'} instead.
    253253         *
    254254         * @param object $details The blog details.
    255255         */
  • src/wp-includes/ms-site.php

    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 ) { 
    121121                 * Fires immediately after a new site is created.
    122122                 *
    123123                 * @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.
    125125                 *
    126126                 * @param int    $site_id    Site ID.
    127127                 * @param int    $user_id    User ID.
    function clean_blog_cache( $blog ) { 
    10261026         * Fires after the blog details cache is cleared.
    10271027         *
    10281028         * @since 3.4.0
    1029          * @deprecated 4.9.0 Use clean_site_cache
     1029         * @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead.
    10301030         *
    10311031         * @param int $blog_id Blog ID.
    10321032         */
  • src/wp-includes/post.php

    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 ) { 
    67306730                 * Fires when a post's status is transitioned from private to published.
    67316731                 *
    67326732                 * @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.
    67346734                 *
    67356735                 * @param int $post_id Post ID.
    67366736                 */
  • src/wp-includes/rest-api/class-wp-rest-server.php

    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 { 
    260260                 * Filters whether the REST API is enabled.
    261261                 *
    262262                 * @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.
    264265                 *
    265266                 * @param bool $rest_enabled Whether the REST API is enabled. Default true.
    266267                 */
  • src/wp-includes/taxonomy.php

    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 = '' ) { 
    42444244                 * Filters the tag link.
    42454245                 *
    42464246                 * @since 2.3.0
    4247                  * @deprecated 2.5.0 Use 'term_link' instead.
     4247                 * @deprecated 2.5.0 Use {@see 'term_link'} instead.
    42484248                 *
    42494249                 * @param string $termlink Tag link URL.
    42504250                 * @param int    $term_id  Term ID.
    function get_term_link( $term, $taxonomy = '' ) { 
    42564256                 * Filters the category link.
    42574257                 *
    42584258                 * @since 1.5.0
    4259                  * @deprecated 2.5.0 Use 'term_link' instead.
     4259                 * @deprecated 2.5.0 Use {@see 'term_link'} instead.
    42604260                 *
    42614261                 * @param string $termlink Category link URL.
    42624262                 * @param int    $term_id  Term ID.
  • src/wp-includes/user.php

    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 ) { 
    22682268         * Use the {@see 'retrieve_password'} hook instead.
    22692269         *
    22702270         * @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.
    22722272         *
    22732273         * @param string $user_login The user login name.
    22742274         */
  • src/wp-login.php

    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 ) { 
    135135         * Filters the title attribute of the header logo above login form.
    136136         *
    137137         * @since 2.1.0
    138          * @deprecated 5.2.0 Use login_headertext
     138         * @deprecated 5.2.0 Use {@see 'login_headertext'} instead.
    139139         *
    140140         * @param string $login_header_title Login header logo title attribute.
    141141         */