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.

Theming Habari Vs Wordpress
Habari vs wordpress?
13 comments
page 440
Post Image The Easy Peasy Way
Get post attacments?
26 comments
page 1065
Are Child Themes The Best Option
Wp child themes?
15 comments
page 1262
Upload From Url
Upload to url?
6 comments
page 326
Silence Is Golden
Silence is golden wordpress?
3 comments
page 213
How To Add Sidebars To A Theme
Html hot add a side bar?
11 comments
page 1053
How To Add Sidebars To A Theme
How to add picture to the wordpress sidebar on sidebarphp?
11 comments
page 1053
Fun With Sidebar Tabs Styling
Position of the tabs thematic?
2 comments
page 336
Using Your Own Url Shortener
Short url?
4 comments
page 1190
Why I Ditched Disqus
Styling disqus widgets?
5 comments
page 1175
Wordpress 25 Exif Fields
Wordpress exif?
12 comments
page 230
Html 5 Gallery
Html 5 gallery?
6 comments
page 1305
Dont Mess With My Toot Toot
Fun with toots?
16 comments
page 599
Dont Mess With My Toot Toot
Fun with toots?
16 comments
page 599
Fun With Sidebar Tabs Styling
Tabs with html css on same page javascript?
2 comments
page 336
Converting Wordpress Themes To Habari
Habari timthumb?
one comment
page 694
Wordpress 25 Exif Fields
Habari timthumb?
12 comments
page 230
Post Image The Easy Peasy Way
Insert conditional image php wp?
26 comments
page 1065
Using Your Own Url Shortener
How to have own url short?
4 comments
page 1190
Using Your Own Url Shortener
Run short url using htaccess?
4 comments
page 1190
Quick N Dirty Replacement Text
Wpupdatepost object?
no comment
page 122
How To Add Sidebars To A Theme
Wordpress sidebar above main sidebars?
11 comments
page 1053
Html 5 Gallery
Html5 simple wordpress theme?
6 comments
page 1305
Dont Mess With My Toot Toot
New posttype not displayed wordpress?
16 comments
page 599
Updating Code Snippets Here
Fun wordpress plugin?
one comment
page 1338
How To Add Sidebars To A Theme
Wp register sidebars?
11 comments
page 1053
Html 5 Gallery
Html5 wordpress theme?
6 comments
page 1305
Post Image The Easy Peasy Way
Get post images?
26 comments
page 1065
Updating Code Snippets Here
Wordpress fun plugins?
one comment
page 1338
Improve Your Typography With Plugins
Wordpress typography plugin?
one comment
page 721
Post Image The Easy Peasy Way
Wordpress get first image large?
26 comments
page 1065
Using Wordpress As A Php Framework
Wordpress create your own framework?
2 comments
page 335
Quick N Dirty Replacement Text
Dirty replacement?
no comment
page 122
  1 query every 1905 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.