WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#53285 new enhancement

Make it easier to determine which features have been merged to core

Reported by: azaozz Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Looking at the last few feature plugins like WordPress Auto-updates and core team plugins like Enable jQuery Migrate Helper, it would be beneficial to have some sort of flag when a new major feature gets merged to core or a core team plugin needs to identify major changes.

The most important use case would be to simplify how old feature plugins get disabled when the feature is merged. In addition having these flags would speed up things a little as function_exists() and version_compare() will no longer be needed.

Change History (5)

#1 @azaozz
4 months ago

Chatting with @hellofromtonya, perhaps this can be an array held in a constant that's defined early, in wp-includes/default-constants.php. It will require some maintenance, and eventually may grow a bit but will still be faster and easier to use than function_exists() and similar.

#2 @hellofromTonya
4 months ago

In some cases such as features merged from Gutenberg, a feature-specific function may not exist to use function_exists.

By providing a feature compat constant, plugins can then detect and not load code for that feature(s).

Adding a version number to the feature compat allows the feature plugin to continue feature development by overriding what's in core and loading its code instead. This would mean that the files/code in core when merged would need to check against this feature compat before loading the files/code into memory.

Last edited 4 months ago by hellofromTonya (previous) (diff)

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


3 months ago

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


3 months ago

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


3 months ago

Note: See TracTickets for help on using tickets.