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
13 comments
page 440
Post Image The Easy Peasy Way
26 comments
page 1065
Are Child Themes The Best Option
15 comments
page 1262
Upload From Url
6 comments
page 326
Silence Is Golden
3 comments
page 213
Fun With Sidebar Tabs Styling
2 comments
page 336
Using Your Own Url Shortener
4 comments
page 1190
Wordpress 25 Exif Fields
12 comments
page 230
Html 5 Gallery
6 comments
page 1305
Dont Mess With My Toot Toot
16 comments
page 599
Dont Mess With My Toot Toot
16 comments
page 599
Fun With Sidebar Tabs Styling
2 comments
page 336
Converting Wordpress Themes To Habari
one comment
page 694
Wordpress 25 Exif Fields
12 comments
page 230
Post Image The Easy Peasy Way
26 comments
page 1065
Using Your Own Url Shortener
4 comments
page 1190
Using Your Own Url Shortener
4 comments
page 1190
Quick N Dirty Replacement Text
no comment
page 122
How To Add Sidebars To A Theme
11 comments
page 1053
Html 5 Gallery
6 comments
page 1305
Dont Mess With My Toot Toot
16 comments
page 599
Updating Code Snippets Here
one comment
page 1338
Html 5 Gallery
6 comments
page 1305
Post Image The Easy Peasy Way
26 comments
page 1065
Updating Code Snippets Here
one comment
page 1338
Improve Your Typography With Plugins
one comment
page 721
Post Image The Easy Peasy Way
26 comments
page 1065
Using Wordpress As A Php Framework
2 comments
page 335
Quick N Dirty Replacement Text
no comment
page 122
1 query every 1905 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.