https://github.com/wpup/features
WordPress setting page for feature flagging interface/implementation
https://github.com/wpup/features
features plugin wordpress
Last synced: 16 days ago
JSON representation
WordPress setting page for feature flagging interface/implementation
- Host: GitHub
- URL: https://github.com/wpup/features
- Owner: wpup
- License: mit
- Created: 2018-04-24T17:07:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T14:21:23.000Z (over 6 years ago)
- Last Synced: 2025-01-01T06:15:48.521Z (over 1 year ago)
- Topics: features, plugin, wordpress
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Features
[](https://travis-ci.org/wpup/features)
[](http://unmaintained.tech/)
WordPress setting page for [php-features](https://github.com/frozzare/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](https://github.com/frozzare/php-features) readme file to know how that package works.
Example:
```php
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:
```php
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:
```php
add_filter( 'features_labels', function () {
return [
'log' => 'Log'
];
} );
```
Change admin menu capability:
```php
add_filter( 'features_capability', function () {
return 'custom-cap';
} );
```
## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)