Experimental Features
WP Experimental Features
by Alley · github.com/alleyinteractive/wp-experimental-features · website
★ 10stars
29kcomposer installs
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/alleyinteractive/wp-experimental-features/archive/refs/heads/develop.zipAlso on Packagist as alleyinteractive/wp-experimental-features:
composer require alleyinteractive/wp-experimental-featuresFrom the readme
Experimental Features
A WordPress plugin that creates a feature flags system for beta testing
experimental features in your themes or plugins.
Usage
Defining Feature Flags
Feature flags are defined using a filter:
Checking the Value of Feature Flags
The value of a feature flag can be checked by running the feature flag slug
through the experimentalfeaturesflag filter. This allows for plugins and
themes to not break if the Experimental Features plugin is deactivated,
because the filter will simply return the default value.
If the flag is not enabled, or if the Experimental Features plugin is not
active, then the default value (first parameter, false in the example above)
will be returned.
If you like, you could create a helper function for this in your plugin or
theme:
Toggling Feature Flags in the Admin
If you navigate to Settings Experimental Features while logged in to the
WordPress admin as an administrator (or a user with the manageoptions
capability) you can turn feature flags on and off via a simple checkbox
interface.
Toggling Feature Flags in the Admin Bar
By default the admin bar will include links to toggle all available feature flags individually. This can be
Read the full README on GitHub →