Opened 4 years ago
Last modified 3 years 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)
#2
@
4 years 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.
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 thanfunction_exists()
and similar.