WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a widget which I want to add a couple of options. The options are effectively 'global' for the widget - username and password details to a secured web service.

So in effect, wherever the widget is used the same parameters will be used.

I presume I should use an add_options_page? Or ...

Add options on the widget itself? Or ...

can you do both?

share|improve this question
up vote 0 down vote accepted

I have answered this myself by adding an options page and adding options to the database. The functions are


add_action('admin_menu', 'yourplugin_menu_');

function yourplugin_menu_() {
    add_options_page('etc etc...
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.