Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#2331 closed defect (fixed)

Code Reference: Incorrect notice for deprecated functions with no @see

Reported by: dimadin Owned by: coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch


Deprecated functions that don't have @see always display version when they were deprecated instead of description that follows after that version.

For example, function get_editable_user_ids() has no @see but has description in @deprecated (Use get_users()). Instead, in notice, you can see "3.1.0 instead.": https://developer.wordpress.org/reference/functions/get_editable_user_ids/

Also, same type of notice is displayed for functions that have no alternative functions at all, like _relocate_children(): https://developer.wordpress.org/reference/functions/_relocate_children/

Problem is that from [2816] $deprecated['content'] is used where $deprecated['description'] should have been used. $deprecated['content'] always holds version when function is deprecated while $deprecated['description'] exists if there is something after version number.

See #1647.

Closes https://github.com/WordPress/phpdoc-parser/issues/183.

Attachments (1)

2331.diff (810 bytes) - added by dimadin 5 years ago.

Download all attachments as: .zip

Change History (2)

5 years ago

#1 @coffee2code
5 years ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 4556:

developer.wordpress.org: Fix deprecation notice banner to use description from @deprecated when no @see is provided.

Props dimadin.
Fixes #2331.

Note: See TracTickets for help on using tickets.