Piklist 0.9.4, the most stable, secure and efficient version of Piklist the world has ever seen, is now available at WordPress.org. With this release we have fixed every known bug, increased overall field support and optimized performance. Let’s get into the details:
Conditional Fields
Piklist has had simple “hide/show” and “update” conditional fields for a while, but we’ve taken it to a whole new level in 0.9.4. You can now use OR in your conditionals, include an array of values, and even check to see if a value is != another field. The format for conditionals mimics WordPress’ meta_query structure, so this should feel natural for developers. Documentation has been updated to reflect these new features. We would like to thank Daniel Rampanelli, a community member, for submitting the initial proof of concept for these conditional enhancements.
Data Sanitization
Since our first release, Piklist has always saved data using standard WordPress methods like $wpdb->prepare to make sure your data is safe before saving to your database. In 0.9.4 we’ve added an additional level of safety with the sanitize parameter. Now you can easily clean your data using powerful WordPress functions like wp_kses, or something as simple as text_field.
1 2 3 4 5 6 7 8 9 10 | piklist('field', array( 'type' => 'text' ,'field' => 'my_sanitized_text' ,'label' => 'Enter Text' ,'sanitize' => array( array( 'type' => 'text_field' // Sanitize safe text ) ) )); |
Of course, you can easily write your own sanitization functions if you choose. Check out our documentation to see how easy it is to add this extra layer of security.
Data Validation
Piklist v0.8.0 introduced the required parameter, a simple way to make sure users enter data in mandatory fields. Now, with the new validate parameter you can access ten (10) rules included with Piklist, or easily add your own. We’ve included a number of rules to get you started, including:
- Validate an email address format and/or the email domain (using the PHP function
checkdnsrr). - Check if a file path entered is an actual file (using the PHP function
file_get_contents). - Verify that an entered image file is actually an image (using the PHP function
exif_imagetype)
1 2 3 4 5 6 7 8 9 10 | piklist('field', array( 'type' => 'text' ,'field' => 'my_image_url' ,'label' => 'Enter an image url' ,'validate' => array( array( 'type' => 'image' // Validate an image file ) ) )); |
We’ve also included a powerful validation rule to let you limit the number of choices a user can make. With this rule you can set a minimum and maximum value for all sorts of fields including:
- Numbers
- Checkboxes, Radio and Multi-selects
- File uploads
- Add Mores
And like the Piklist Sanitization rules, you can easily add your own. Check out the documentation for the full list of options.
Widgets
Creating Widgets is so easy with Piklist, that we had to rewrite how Widgets work. Yes, you read that correctly… widgets are so simple that we had to rewrite the Piklist widget code. Some Piklist users are creating 20 or 30 plugins for some sites, and with that many widgets the response time was pretty slow. Well, this has been fixed and you can feel free to create as many widgets as you like, and even use them in the WordPress Theme Customizer. If you want to learn how easy it is to build Widgets with Piklist, here’s a tutorial to show you how.
Piklist Demos
The built in demos have been updated to show off all these new features. Just head over to Piklist > Add-ons to active them.
Great additions. This was posted on the forum but I don’t know if its a known bug but on Windows(WAMP) there is an issue with file paths that causes errors and the about and settings page fail to display.
https://piklist.com/support/topic/piklist-about-settings-pages-do-not-display/
Has this been fixed?
“With this release we have fixed every known bug”… it was a known bug, so it was fixed. ;)