[wp-trac] [WordPress Trac] #44203: Native fields for API key

WordPress Trac noreply at wordpress.org
Wed May 23 11:51:52 UTC 2018

#44203: Native fields for API key
 Reporter:  tazotodua     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
 I think Captcha-protection is somehow "must-have" thing (I use on all my
 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`.

Ticket URL: <https://core.trac.wordpress.org/ticket/44203>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list