Updated! New media manager, HTML5 inputs & new space efficient table view

Simple Fields version 1.2 has just been released. Some nice things to mention with this release:

  • Support for the new media manager that was introduced in WordPress 3.5 has been added
  • Fields can now be added to attachments
  • The settings pages is now a bit nicer and more WordPress-ish loooking. Also has more useful info added to them. Oh, they are really nice indeed.
  • There is a new (but optional) space efficient table view
  • Placeholders can be added to text and textarea fields
  • Fancy HTML5 input types have been added as sub types to the text field
  • Lots of filters added, making it possible to customize Simple Fields using plain PHP. Like choosing a post connector for a post based on it’s post type or what categories it belongs to. Cool stuff.

You can grab the latest version over at WordPress.org and there’s also a more detailed change log there.

For bug reports use GitHub or the WordPress support forum.

HTML5 input types

With this version it’s possible to select some of the new input types that are available in HTML5, for example: date, color, url, email and range. Support for these input types depends on your browser, but in Chrome they look something like this (this screenshot also shows the placeholder attribute being used):

screenshot-4

Filters

Filters in WordPress are awesome. I’m not quite sure why it took so long for them to arrive in Simple Fields too, but they are here now for sure!

Two of my favorite filters in Simple Fields are “simple_fields_get_selected_connector_for_post” and “simple_fields_add_post_edit_side_field_settings”. Let me show you what you can do with them:


// Add our hooks to simple fields' filters
add_filter("simple_fields_get_selected_connector_for_post", "my_simple_fields_get_selected_connector_for_post", 10, 2);
add_filter("simple_fields_add_post_edit_side_field_settings", "my_simple_fields_add_post_edit_side_field_settings", 10, 2);

/**
* The simple_fields_add_post_edit_side_field_settings filter is used to determine if the
* simple fields metabox field on the post edit screen should be visible or not
*
* In this example we choose to not show simple fields metabox if the post type
* of the post we are editing is "products", i.e. a user can not select another
* post connector for this post type
*/
function simple_fields_add_post_edit_side_field_settings($bool, $post) {

if ("products" === $post->post_type) {
$bool = false;
}

return $bool;

}

/**
* The simple_fields_get_selected_connector_for_post filter is used to
* determine what post connector is being used for a post
*
* In this case we return the products_post_connector when the user is editing
* or a visitor is visiting a post of type "products"
*/
function simple_fields_get_selected_connector_for_post($connector_id, $post) {

if ("products" === $post->post_type) {
$connector_id = "products_post_connector";
}

return $connector_id;

}

The changelog has a list of (hopefully) all of the filters.

Table view

The table view is a great space saver for field group with 1-5 fields. It looks like this and as you can see it’s very suitable for attachments or image slideshows:

The new table view – perfect for attachments and image slideshows

The new table view – perfect for attachments and image slideshows

To enable the table view just go to one of your field groups an tick the new “Use table view”-checkbox.

New and better admin GUI

The admin interface overview screen has gotten a nice facelift. It now gives you a better overview of all your field groups and post connectors. This is what the admin GUI looks for here on simple-fields.com:

new-settings-gui

Ok. That’s it for now. Hope you’ll enjoy these new functions.

3 thoughts on “Updated! New media manager, HTML5 inputs & new space efficient table view

Leave a Reply