tareq1988 / wp-recaptcha-integration

WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
https://wordpress.org/plugins/wp-recaptcha-integration
50 stars 31 forks source link

Global definition of option values using enviromental variables, constants and/or filters #85

Closed felipelavinz closed 6 years ago

felipelavinz commented 6 years ago

I just added the possibility to use env() to get enviromental variables, use constants or filter option values.

This is useful for multy-tenancy WordPress installations, where a single codebase serves different sites and you might need to share common configurations with all of them -- this is a somewhat legacy case before multi-networks were a thing, except the "env" definition which it's compatible with more modern scenarios such as using the Bedrock installation,

mcguffin commented 6 years ago

First: Thanks for caring! I want to keep code complexity and the number of use cases to consider as low as possible. So I am sorry to tell you that I'm not going to merge this. However, you can achieve the same result by using the pre_option_{$option} and/or pre_site_option_{$option} filters in a mu-plugin.

felipelavinz commented 6 years ago

Hi! I totally understand, thanks for your work on this!

I'll look into using the filters and maybe write a blog post in case it might be useful for others.