jamesrwilliams / flagpole

Easily register and work with feature flags in your theme with Flagpole. This WordPress plugin allows developers to easily configure feature flags in your WordPress themes.
MIT License
24 stars 7 forks source link

Add configuration via config file #24

Open jamesrwilliams opened 5 years ago

jamesrwilliams commented 5 years ago

cmjaimet who has written a similar plugin has a wonderful idea of a JSON configuration option for the flags rather than being written in the theme's code. I think we should add this to our plugin also as another method of delcaring feature flags.

This does open up issues around load order and duplicate keys, however. Maybe the JSON file takes presedance over and PHP delcarations with any duplicates erroring as per #22. Thoughts?

jamesrwilliams commented 2 years ago

Expanding scope to include YAML or other formats. Maybe a property on a sites composer extra node?

jenkoian commented 2 years ago

We've added yaml support in our base plugin in work if you wanted to see what an implementation might look like https://github.com/boxuk/boxuk-base-wp-plugin/tree/main/src/FeatureFlag

Example flags.yml: https://github.com/boxuk/wp-project-skeleton/blob/main/wp-content/mu-plugins/000-boxuk/flags.yaml