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.

  • 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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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