New Version of DMG WP Theme Options Coming Soon

Categories: Blog, Development, JavaScript, jQuery, WordPress

Jun 17
2011

For a while now I wanted to add a feature to DMG WordPress Theme Options – that feature being tabbed sections. I played with it a while back and it just seemed like it wasn’t going to happen.

My mistake was trying to manipulate WordPress settings functions to spit out the code I needed. It just wasn’t going to happen that way. I had thought about using jQuery, but that seemed like it would be a nightmare. Next time I’ll try something before I think.

Having jQuery move everything into place and add the code I needed turned out to be pretty simple. 30 lines of code in total – including comments and empty lines to make life easier.

Tabbed sections are completely optional. You may find that it’s something you just don’t need for the few options you have. However, if your theme has a ton of options at least you can make them a little easier to find.

DMG WP Theme Options with Tabs - Pepper Grinder UI Theme

DMG WP Theme Options with Tabs - Pepper Grinder UI Theme

Other Changes

While I was working on adding the tabs I took care of a few other bugs that I’ve been noticing. Then while fixing those bugs I couldn’t help myself to make a few other long overdue changes as well.

All in all here’s what you can expect in the next release:

  • Tabbed sections (optional, set in the theme-options.php file).
  • $usetab (in the theme-options.php file) allows you to use tabbed sections or not.
  • JavaScript files (mainly jQuery UI files) are only included as needed.
  • CSS files only included as needed.
  • $usedate is no longer needed. Script will determine if type date was used and include all needed files.
  • Modified code that housed the option form to make working with tabs easier (on myself).
  • Removed the color picker (more on this below).
  • Removed desc from section type. Allowing descriptions on all fields made this almost useless. Plus the result was spitting out some invalid code.
  • Hidden inputs (hidden type) now sets the value attribute using std and not what was stored in the options. This means the value can be changed at any time and no longer needs to have the plugin re-activated to make the value attribute change.
  • checkboxes and radio (including for wpas when using wordpress type) will no longer set the name to be a label. There’s no need for it as these typically have more than one field grouped together.
  • Fixed error with label tags being output when there was no desc for array item.
  • Datepicker jQuery call now triggered on class dmgDatePicker and not the id attribute.
  • Restructured the directory to make things easier to find.

Color Picker Removed

While I originally thought the color picker was a pretty good idea, I don’t see a need for it right now. The color picker that DMG WordPress Theme Options was using was nice but it was a bit bulky. If I find something better I may put this option back in, but for now you’ll just have to use a text field and run a validation check to make sure the string is valid for your needs.

Testers Wanted

By the way, while I test DMG WordPress Theme Options as much as I can it’s always nice to have a few eyes have a look at this thing before I offer it up to the public. So if you’re interested in helping me test drop me a line using the contact form. It doesn’t pay but at least you get to try out the newest version of DMG WordPress Theme Options before anyone else.

It’s Here!

DMG WordPress Theme Options version 2.0 is available for download!

 

Comments

Leave a comment

 

Leave a comment

Read comments

 



Please do not submit your comment more than once. It will appear once it has been approved.