Today we’d like to introduce you to a new tool for WordPress theme developers. It’s a theme options framework that we think you’re going to fall in love with.
Get a free WPMU DEV plugin, plus free weekly tips and resources for using WordPress.
NHP Theme Options Framework was created by developer Lee Mason of No Half Pixels. Though there are many other options frameworks already available, Mason’s goal was to build something that would be easily extendable and support custom error handling. The NHP options framework is launching with a ridiculous number of features.
Some of the NHP framework’s most remarkable features include:
- Custom Error Handling – Using the Validation methods you can create custom error messages for each field type.
- Extendable Field Classes – Easily create custom field classes for use in your theme options. Instructions are available in the detailed wiki.
- Built In Field Types – Contains many built in field types for easy use (all basic field types like text, checkbox, select, upload are built in).
- Extendable Validation Classes – Want custom validation? Just use the extendable Validation Class methods.
- Built In Validation Methods – Contains many built in validation methods for clean data saving (email, url, numeric, escape js, no html, html).
- Fully Customizable – Many Hook points to customise the Framework to your requirements.
This is just a sampling of the built-in field types:
I highly encourage you to visit the NHP framework’s homepage on github to explore the vast number of built in features. The best part is that every function/action can be customized.
Simple to Use:
Including the options framework in your theme is very easy. You simply require the theme-options.php file in your themes functions.php file, like this:
require( dirname( __FILE__ ) . '/theme-options.php' );
Then you can change the settings as written in the theme-options.php file.
The documentation for NHP is extensive and will continue to grow as new hook points and configuration options are added with each update. This options framework is a theme developer’s dream. It enables you keep your focus on creating beautiful themes. The NHP Theme Options Framework is definitely a tool you’ll want to bookmark for future use.