Make WordPress Core


Ignore:
Timestamp:
04/17/2013 04:08:46 AM (11 years ago)
Author:
markjaquith
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r24003 r24006  
    24072407
    24082408    if ( ! empty( $meta['image'] ) ) {
    2409         $post->format_content = sprintf( $link_fmt, wp_get_attachment_image( $meta['image'], $attached_size ) );
     2409        if ( is_numeric( $meta['image'] ) )
     2410            $image = wp_get_attachment_image( absint( $meta['image'] ), $attached_size );
     2411        elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta['image'] ) )
     2412            $image = do_shortcode( $meta['image'] );
     2413        elseif ( ! preg_match( '#<[^>]+>#', $meta['image'] ) )
     2414            $image = sprintf( '<img src="%s" alt="" />', esc_url( $meta['image'] ) );
     2415        else
     2416            $image = $meta['image'];
     2417
     2418        $post->format_content = sprintf( $link_fmt, $image );
    24102419        return $post->format_content;
    24112420    }
Note: See TracChangeset for help on using the changeset viewer.