WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 2 weeks ago

#50807 new feature request

Introduce a function for deprecated options

Reported by: 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 3 months ago.

Download all attachments as: .zip

Change History (7)

@desrosj
3 months ago

#1 @desrosj
3 months 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
3 months 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
3 months 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 weeks ago

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


2 weeks ago

#6 @hellofromTonya
2 weeks 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.