New Post Format UI chooser treatment in response to testing.

* Bigger icons
* Format description under each
* UI hides after choice
* Saving without choosing implies "Standard"
* Helpful text, with "Change format" link

see #24046. props lessbloat, wonderboymusic.

git-svn-id: http://core.svn.wordpress.org/trunk@24006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith
2013-04-17 04:08:46 +00:00
parent 7ed04565bb
commit 56d5d62a19
7 changed files with 271 additions and 211 deletions

View File

@@ -191,7 +191,7 @@
props = wp.media.string.props( props, attachment );
classes = props.classes || [];
img.src = props.url;
img.src = attachment.url;
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
// Only assign the align class to the image if we're not printing

View File

@@ -2406,7 +2406,16 @@ function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
$link_fmt = '<a href="' . esc_url( $meta['url'] ) . '">%s</a>';
if ( ! empty( $meta['image'] ) ) {
$post->format_content = sprintf( $link_fmt, wp_get_attachment_image( $meta['image'], $attached_size ) );
if ( is_numeric( $meta['image'] ) )
$image = wp_get_attachment_image( absint( $meta['image'] ), $attached_size );
elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta['image'] ) )
$image = do_shortcode( $meta['image'] );
elseif ( ! preg_match( '#<[^>]+>#', $meta['image'] ) )
$image = sprintf( '<img src="%s" alt="" />', esc_url( $meta['image'] ) );
else
$image = $meta['image'];
$post->format_content = sprintf( $link_fmt, $image );
return $post->format_content;
}