Opened 13 minutes ago
#44203 new defect (bug)
Native fields for API key
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
I think Captcha-protection is somehow "must-have" thing (I use on all my sites). I'ts not arguable that most of users use Google ReCaptcha. However, every new plugin we add, requires us to again and again enter (copy paste) the same key pairs in every individual plugin.
It could have been good, if there were fields in "general options" dashboard settings page (or somewhere), and plugins can access like this:
if ( !get_option("google_recaptcha_secret_key"))
echo 'Please, enter ReCaptcha key pairs in <a href="./options-general.php">settings page</a>';
However, it can be done so, as WP clean installation, itself had hidden those fields, but the plugins (any of installed plugin) could make it force WP to show that field, like:
add_filter('admin_shown_fields', function($args){ $args[] = 'GOOGLE_RECAPTCHA'; return $args; } );
also, the concept can be extended and WP can have several ready FIELD PAIRS for other frequently-used APIs too, which can be activated using above filter, and can be obtained with get_option.