888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

November 11, 2007

How can plugin development be made even easier?

If you’ve ever developed a WordPress plugin (if not why not?) you have probably found that a lot of your time is taken up with things that are effectively a default. This could be something as simple as adding a wrapper div around an admin page or more complicated like accessing a database table.

WordPress abstracts some of this away already; You can save and retrieve options for your plugin without touching the database at all but there are many other cases where things could probably be so much simpler.

I’d like to know what those things are.

Feedback on my plugin generator has been great and I plan to continue developing it, but I want to make things easier still so I want you to tell me what you find to be a chore. What can’t you do simply that you should be able to, what do you have to code which should be automatic, etc.

To get the ball rolling here is one thing that I find a pain: user input. I want to be able to specify that a form field is required, and do nothing. I don’t want to check if the form has been submitted, I don’t want to check if it has content or not, I just want to know that every required field is completed.

How about you?

p.s. If you’re wondering where the post title comes from have a read of this.

Poll Daddy Reviewed
Polldaddy poll?
2 comments
page 42
Why I Ditched Disqus
Add wordpress comments to friendfeed?
5 comments
page 1175
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp display all post images?
26 comments
page 1065
Quick N Dirty Post Exclusion
Fitler theloop addfilter?
11 comments
page 124
Using Your Own Url Shortener
Constructor and link shortner?
4 comments
page 1190
My Experience Of Flexx
Flexx of genesis wp theme?
4 comments
page 1026
Html 5 Gallery
Html5?
6 comments
page 1305
Wordpress Chat
Tchat page wordpress?
3 comments
page 1308
Quick N Dirty Post Exclusion
Filter wordpress posts plugin?
11 comments
page 124
Post Image The Easy Peasy Way
Wp add attachment?
26 comments
page 1065
Html 5 Gallery
Html 5 gallery?
6 comments
page 1305
Html 5 Gallery
Pictures html5?
6 comments
page 1305
Html 5 Gallery
Pictures html5?
6 comments
page 1305
Post Image The Easy Peasy Way
Wordpress attach images to post?
26 comments
page 1065
Post Image The Easy Peasy Way
Wp post orderby?
26 comments
page 1065
Auto Cycle Fun With Sidebar Tabs
Wordpress make your plugin updateable?
one comment
page 1129
Wordpress Chat
Postimagetheeasypeasyway?
3 comments
page 1308
Using Your Own Url Shortener
How to flushrewriterules?
4 comments
page 1190
Custom Hooks For Admin Pages
Addaction adminpost?
one comment
page 430
Custom Hooks For Admin Pages
Addaction adminpost?
one comment
page 430
Wordpress Chat
Chat themes?
3 comments
page 1308
Html 5 Gallery
Html5 wordpress?
6 comments
page 1305
Html 5 Gallery
Html5 photo gallery?
6 comments
page 1305
How To Add Sidebars To A Theme
Add more than one widget area to wordpress?
10 comments
page 1053
Post Image The Easy Peasy Way
Wordpress postimage img tag?
26 comments
page 1065
Html 5 Gallery
Photo gallery in html 5?
6 comments
page 1305
Quick N Dirty Admin Login Screen
Admin login?
no comment
page 128
Why I Ditched Disqus
Disqus themes?
5 comments
page 1175
My Experience Of Flexx
Ithemes flexx theme?
4 comments
page 1026
Theming Habari Vs Wordpress
Habari vs wordpress?
13 comments
page 440
3 Ways To Speed Up Your Blog Without A Cache Plugin
Wp plugin speedup page?
one comment
page 1321
  1 query every 1310 seconds, updated 1 seconds ago.
Thursday, 8am
 __
(__)
   `

 Andrew Rickmann

Tom,

The constructor will populate the admin options when it loads, what you need to do is to capture the post options as part of the admin page itself, rewrite it and save it, before any of the content is loaded. For example:

function output_menu_function(){

if ( isset($_POST['whatever'] ) {

//validation

$adminOptions['key'] = $_POST['x'];

$this->saveAdminOptions();

}
?>
admin page here
}

If you are still having problems let me know.

Thursday, 5am
 __
(__)
   `

 Tom

I realize this may be a noob question, but I’m having trouble saving my admin options with a plugin generated from a previous version of the generator. I have no problem replacing the admin menu with my html form and getting options to populate into the fields, but I’m not sure the best way to save those options. It seems like the constructor of the plugin class is reloading the options before I can save any options that were submitted. I’ve try catching the post of the form in the constructor and saving the options, else refetching them, but that doesn’t seem to work. Any help is appreciated.