Since post format meta for images now takes an attachment ID only, make sure we label it appropriately and don't do things like esc_url() the value. fixes #23900.

git-svn-id: https://develop.svn.wordpress.org/trunk@23874 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2013-03-29 20:56:18 +00:00
parent a2855f94b3
commit bd32ccb3ca
1 changed files with 6 additions and 4 deletions

View File

@ -20,8 +20,10 @@ $format_meta = get_post_format_meta( $post_ID );
<?php
$image = false;
if ( isset( $format_meta['image'] ) )
$image = is_numeric( $format_meta['image'] ) ? wp_get_attachment_url( $format_meta['image'] ) : $format_meta['image'];
if ( ! empty( $format_meta['image'] ) && is_numeric( $format_meta['image'] ) ) {
$format_meta['image'] = absint( $format_meta['image'] );
$image = wp_get_attachment_url( $format_meta['image'] );
}
?>
<div class="field wp-format-image">
<div data-format="image" class="wp-format-media-holder hide-if-no-js<?php if ( ! $image ) echo ' empty'; ?>">
@ -36,8 +38,8 @@ $format_meta = get_post_format_meta( $post_ID );
?>
</a>
</div>
<label for="_wp_format_image" class="screen-reader-text"><?php _e( 'Image URL' ); ?>:</label>
<input id="wp_format_image" type="hidden" name="_wp_format_image" value="<?php echo esc_url( $format_meta['image'] ); ?>" placeholder="<?php esc_attr_e( 'Image URL' ); ?>" class="widefat" />
<label for="_wp_format_image" class="screen-reader-text"><?php _e( 'Attachment ID' ); ?>:</label>
<input id="wp_format_image" type="hidden" name="_wp_format_image" value="<?php esc_attr_e( $format_meta['image'] ); ?>" placeholder="<?php esc_attr_e( 'Attachment ID' ); ?>" class="widefat" />
</div>
<div class="field wp-format-link wp-format-quote wp-format-image">