Make WordPress Core

Opened 5 years ago

Last modified 4 years ago

#50807 new feature request

Introduce a function for deprecated options

Reported by: desrosj's profile desrosj Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch needs-refresh
Focuses: Cc:

Description

While tackling #50413, two option keys were renamed. In the absence of a _deprecated_function() equivalent for options, a temporary backwards compatibility fix was added in [48575] with the goal of exploring a _deprecate_option() function in 5.6.

Attachments (1)

approach-2.diff (11.2 KB) - added by desrosj 5 years ago.

Download all attachments as: .zip

Change History (7)

@desrosj
5 years ago

#1 @desrosj
5 years ago

  • Keywords needs-refresh added

approach-2.diff was an initial first pass at what this may look like originally uploaded to ticket:50413#comment:38.

It needs a refresh, and still needs additional considerations. From the previous comment:

It is not yet handling database queries (which key should be checked retrieved/updated/deleted when calling a deprecated option? The new one? The old one?), but it does ensure that both the new and old actions and filters run.

#2 @TobiasBg
5 years ago

The call _deprecated_option( $option, '5.5.0', $deprecated_options[ $option ] ); won't work for deprecated options in future versions. The version information probably has to go to get_deprecated_options().

#3 @desrosj
5 years ago

Ah yes. That will need an adjustment. The context of approach-2.diff was limited to 5.5.

I think I like the suggestion of using get_deprecated_options() to provide the version details.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


4 years ago

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


4 years ago

#6 @hellofromTonya
4 years ago

  • Milestone changed from 5.6 to Future Release

During today's core scrub, agreed this ticket needs more work and to punt it to Future Release.

If any maintainer or committer feels this can be resolved in time, or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

Note: See TracTickets for help on using tickets.