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 started developing a plugin which only required a few options. But over time the number of settings grew, and I want to move most of them to a separate page. I've seen quite a few tutorials about options pages and about widgets, but I couldn't find one that explained how to create an options page for a particular widget.

How can this be achieved ? I intend to keep only a couple of settings that would affect individual instances, and the rest would be global, and on the options page.

share|improve this question
    
Hate to link my own plugin, but check out the code in my disqus recent comments widget plugin, I have both an options page using the settings api and individual options for each widget instance: wordpress.org/plugins/disqus-recent-comments-widget –  Andrew Bartel May 21 '13 at 16:15
    
@AndrewBartel I was actually going to ask for a simple example plugin, yours looks just like what I needed :D –  Mihai Rotaru May 21 '13 at 16:24
add comment

1 Answer

Your widget is part of a plugin (per the first sentence of the question), so what you are really talking about is making a plugin administration page, which you would do with add_menu_page, add_submenu_page, or one of the more specialize menu page functions. That is the nutshell version of the answer.

There are a lot of questions and answers here about doing that and there are examples in the Codex. Once you get started, if you have trouble, [edit] the question with your code and with an explanation of the specific problems you are having, ping me (@s_ha_dum in a comment) and I will edit the answer. Otherwise, it is really a very broad question.

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.