Post Formats UI Update, 2/21
First run commit, mostly for soaking of functionality, went into trunk on Monday. This includes fallback output for theme compat and fields in the admin. The admin UI does not represent anything final – especially of note is the tabs, which are essentially the way they are in order to reuse CSS and avoid adding temporary code to core.
Our next steps for the actual building of the UI are:
- Hook up the media modal to the gallery field.
- Doing some preview magic for audio/video, also possibly hooking up the media modal.
- Adding icons for each selector (currently tabs) and some of the inputs.
- Experimenting with interactions for the selector itself – it still seems that a selector that collapses on itself once a format has been chosen, rather than tabs that always show everything, will be better.
- Hiding the title and/or the content for some of the post types. @melchoyce’s wireframes show which formats should have the title hidden by default; note that we should always allow the title to be edited, even if hidden under a toggle. The same goes for the content – can be hidden for some of the post types where the content serves more as a description or commentary on the other data provided for the format (image, gallery, audio, video, and quote come to mind).
Related to hiding the title, we need to add a way for titles to be smartly auto-generated/populated for those formats where a title isn’t prominently “required”. Some of the ones that also don’t need content may be served well with some smart detection if possible, e.g. the title of a video or image.
After discussion about old and new themes and content, we’ve chosen to go a little more aggressive with compat output. We had previously attempted using the current add_theme_support( ‘post-formats’ ) implementation to determine whether or not compat output should appear, but it quickly became apparent that it would create less-than-ideal situations with themes that supported post formats in the original style but have not updated. We’ve now introduced add_theme_support( ‘structured-post-formats’ ) for themes to indicate that they handle the metadata for a given format(s) and that core need not add fallback output. See the commit message on r23467 for more details.
The next step for fallback output is to accommodate new-style themes (that is, themes that specifically handle metadata) with old-style content. The Codex has recommendations for content entry/handling that will help us figure out what might have previously been done for post format support. @wonderboymusic has started work on functions to parse out relevant format data from the content itself: #23570 (URL), #23572 (audio/video), and #22960 (getting images from a gallery shortcode, especially the first). We’ll need more for other formats, but this is a start. While that is going on, we’ve been discussing what the theme output layer would look like and how de-duplication would work. “Cutting” the parsed-out data from the content itself before display is, again, a bit aggressive, but seems likely to be the best way forward (noting that it would be on display only, not actually altering the user’s content). See post-dev chat IRC logs for more details: https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2013-02-20&sort=asc#m560171
Finally, note that we’ve created a Post Formats component in Trac. There will sometimes be some overlap between components, but especially for the 3.6 cycle, let’s put anything that relates to getting this feature working in that component so we have it handy.
Beau Lebens 10:59 pm on February 22, 2013 Permalink
Also of interest is #23282, which adds audio and video players to core to handle those post formats (and optionally be used anywhere else).
Helen Hou-Sandi 12:53 am on February 23, 2013 Permalink
Good call, I keep forgetting to loop back to that.
Harish Chouhan 7:30 pm on February 23, 2013 Permalink
Is it final that mediaelement would be used?
Anointed 2:50 am on March 7, 2013 Permalink
I’m hoping that other systems other than medialementjs will be considered. Another ‘top” Option is definitely mwEmbed by Kaltura https://github.com/kaltura/mwEmbed
Helen Hou-Sandi 2:52 am on March 7, 2013 Permalink
Licensing?
Anointed 3:02 am on March 7, 2013 Permalink
All mwEmbed code is released under the AGPLv3 unless a different license for a particular library is specified in the applicable library path
*I’m sure it could be adjusted if necessary
Anointed 3:05 am on March 7, 2013 Permalink
Also, spend a few mins on the git site. Check the level of work put into this project over the years as one of the top active code sets on git. Then do a little digging into who kaltura is, (if you have watched a movie on an airplaine in the last few years, then odds are, it was built by kaltura). Bottom line, kaltura is one huge beast that would benefit both WP and Kaltura.
Harish Chouhan 6:54 pm on February 23, 2013 Permalink
Just a question,
For the meta field Image, will only attachment ID work, or if in a theme we are saving URL of the image in the “_wp_format_image” field, once WP 3.6 is released, will it work?
Helen Hou-Sandi 6:58 pm on February 23, 2013 Permalink
A URL will work – the media modal just hasn’t had that panel added yet.
Harish Chouhan 2:07 pm on February 26, 2013 Permalink
@helen,
Currently the URL field for formats such as Link, Image & Quote is saved as _wp_format_url. Is this approach final? Or there is still chance of this being changed?
Helen Hou-Sandi 3:02 pm on February 26, 2013 Permalink
It shouldn’t really matter to you if the meta key name changes or not – we’ve already introduced get_post_format_meta() as a helper retrieval function. It might be helpful if you could explain why you are asking these questions.
Harish Chouhan 6:16 pm on February 26, 2013 Permalink
Hi Helen, since a year or more I have been using CF-Post-Format plugin which has different URL meta fields for Link & Quote format. I run a WordPress network and to avoid changes to my new themes in future, I am trying to follow the meta_key name based on WordPress 3.6. This will ensure I just have to remove the plugin when 3.6 is released.
I also wanted to make a suggestion about Gallery meta box. Can you please let me know the best place to make that suggestion?
Helen Hou-Sandi 6:22 pm on February 26, 2013 Permalink
We’re in active development – I would not change anything you are currently doing yet. You can make your suggestion here or on #19570.
rudwolf 3:41 am on February 25, 2013 Permalink
Is there any planning to make filter and action hooks so we could be able to create our own new types of posts?
Helen Hou-Sandi 7:07 pm on February 25, 2013 Permalink
No, post formats are not extensible and we will not be changing that.
Lance Willett 6:00 am on February 26, 2013 Permalink
I added a bunch of related tickets to for the default themes:
Twenty Ten: gallery post format – #23617
Twenty Eleven: gallery post format – #22907
Twenty Eleven: link post format – #23618
Twenty Thirteen: link post format – #23619
Twenty Thirteen: video and image post formats – #23620
Twenty Thirteen: gallery post format – #23621
Seems like only Twenty Thirteen will need
add_theme_support( 'structured-post-formats' );at this time.lessbloat 6:35 pm on March 4, 2013 Permalink
Played with another design for the post formats selector this morning.
Have a look:
On load


Active
Formats without a title
I figured it would be fairly discoverable, much less in your face than tabs, and work well for accessibility.
Thoughts?
Seth Rubenstein 8:54 pm on March 6, 2013 Permalink
I’m a fan. Agreed, much less in your face than tabs. Discoverable but out of the way.
mattyrob 8:57 pm on March 8, 2013 Permalink
+1 from me for the cleaner interface. The tabs take way too much screen space and will surely just irritate bloggers who don’t use this aspect of WordPress.
Drew Jaynes (DrewAPicture) 6:49 pm on March 5, 2013 Permalink
I really like this a lot. It fits with the existing UI much more seamlessly and it’s discoverable enough while not completely taking over the post editor like the tabs.