wpup/features

WordPress setting page page for feature flagging interface/implementation

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:wordpress-plugin

v1.0.1 2018-04-25 06:39 UTC

This package is auto-updated.

Last update: 2024-03-29 03:32:27 UTC


README

Build Status No Maintenance Intended

WordPress setting page for php-features. That package is installed when using this plugin so no need to install it yourself.

Install

composer require wpup/features

Usage

First read php-features readme file to know how that package works.

Example:

features( [
    'log'      => false,
    'checkout' => true
] );

Best practice is the set features before WordPress are loaded, e.g config files.

Filters

Add custom to description to features setting page:

add_filter( 'features_description', function () {
    return 'my custom description';
} );

No HTML is allowed since the description is escaped.

Add custom labels to admin instead of feature keys:

add_filter( 'features_labels', function () {
    return [
        'log' => 'Log'
    ];
} );

Change admin menu capability:

add_filter( 'features_capability', function () {
    return 'custom-cap';
} );

License

MIT © Fredrik Forsmo