Make WordPress Core

Opened 3 years ago

Last modified 21 months ago

#23454 new enhancement

_deprecated_function Messages

Reported by: mikejolley Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.5
Component: General Keywords: has-patch 3.9-early
Focuses: Cc:


Unlike _deprecated_file and _deprecated_argument, the _deprecated_function function has no option to append a message to the triggered notice.

I propose adding this to make it consistant with the other 2 functions. Patch to follow.

Attachments (1)

deprecated-function-enhancement.23454.diff (2.3 KB) - added by mikejolley 3 years ago.
Patch for #23454

Download all attachments as: .zip

Change History (6)

comment:1 @SergeyBiryukov2 years ago

  • Version changed from trunk to 3.5

comment:2 @mikejolley21 months ago

@SergeyBiryukov this change is fairly trivial - any chance it will make it into 3.9?

comment:3 @SergeyBiryukov21 months ago

  • Keywords 3.9-early added
  • Milestone changed from Awaiting Review to Future Release

comment:4 @nacin21 months ago

We haven't had a need for this in core. The reason is because both functions can pretty well describe why one is deprecated for the other. In the case of arguments and files, things are less obvious.

comment:5 @mikejolley21 months ago

@nacin I cannot remember the exact case I needed it (10 months ago!) but if you are deprecating a function and there is no replacement, or their is a replacement function that is substantially different, you cannot add any explanation to your message - all you can currently get it to output is:

"X is deprecated since version X with no alternative available."

The change would allow us to add more explanation, and is perfectly backwards compatible with existing uses. Not to mention making it work in line with the other _deprecated functions. Are there any disadvantages to adding it I'm not seeing?

Note: See TracTickets for help on using tickets.