admin管理员组

文章数量:1426047

I have several custom plugins that do very different things but I use on each of them (or almost) the Jenkins and Mantis Rest APIs. For the moment, the API settings (as URL or tokens) are hard coded in the plugin codes, but I would like to centralize this information on a settings page.

I found a good tutorial to add a plugin settings page but it would require a settings page for each plugin when the information would be the same...

Would anyone have a solution?

I have several custom plugins that do very different things but I use on each of them (or almost) the Jenkins and Mantis Rest APIs. For the moment, the API settings (as URL or tokens) are hard coded in the plugin codes, but I would like to centralize this information on a settings page.

I found a good tutorial to add a plugin settings page but it would require a settings page for each plugin when the information would be the same...

Would anyone have a solution?

Share Improve this question asked May 24, 2019 at 12:54 ninagathninagath 1033 bronze badges 1
  • How about a global (theme level) options page? codex.wordpress/Creating_Options_Pages – jdm2112 Commented May 24, 2019 at 15:55
Add a comment  | 

1 Answer 1

Reset to default 0

Perhaps you could create a dedicated settings plugin, which you would use to add single settings page and register separate section and setting for each token/url/etc.

As the settings are saved to the database you can get them with get_option( 'setting_name' ) in any other plugin whenever you need.

本文标签: Multiple plugins linked to same settings page