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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user