Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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_option('yourpluginoption1','value');
add_option('yourpluginoption2','value');

add_action('admin_menu', 'yourplugin_menu_');

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

Your Answer

 
discard

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.