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
2 comments
page 42
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
Post Image The Easy Peasy Way
26 comments
page 1065
Quick N Dirty Post Exclusion
11 comments
page 124
Using Your Own Url Shortener
4 comments
page 1190
My Experience Of Flexx
4 comments
page 1026
Html 5 Gallery
6 comments
page 1305
Wordpress Chat
3 comments
page 1308
Quick N Dirty Post Exclusion
11 comments
page 124
Post Image The Easy Peasy Way
26 comments
page 1065
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
Post Image The Easy Peasy Way
26 comments
page 1065
Post Image The Easy Peasy Way
26 comments
page 1065
Auto Cycle Fun With Sidebar Tabs
one comment
page 1129
Wordpress Chat
3 comments
page 1308
Using Your Own Url Shortener
4 comments
page 1190
Custom Hooks For Admin Pages
one comment
page 430
Custom Hooks For Admin Pages
one comment
page 430
Wordpress Chat
3 comments
page 1308
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
How To Add Sidebars To A Theme
10 comments
page 1053
Post Image The Easy Peasy Way
26 comments
page 1065
Html 5 Gallery
6 comments
page 1305
Quick N Dirty Admin Login Screen
no comment
page 128
My Experience Of Flexx
4 comments
page 1026
Theming Habari Vs Wordpress
13 comments
page 440
3 Ways To Speed Up Your Blog Without A Cache Plugin
one comment
page 1321
1 query every 1310 seconds, updated 1 seconds ago.
(__)
`
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.
(__)
`
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.