diff --git wp-admin/js/post-formats.js wp-admin/js/post-formats.js
index 4a1b527..283fff8 100644
|
|
|
window.wp = window.wp || {}; |
| 118 | 118 | mediaPreview('video', url, mime); |
| 119 | 119 | } else { |
| 120 | 120 | // set the hidden input's value |
| 121 | | $field.val(url); |
| | 121 | $field.val(id); |
| 122 | 122 | // Show the image in the placeholder |
| 123 | 123 | $el.html('<img src="' + url + '" />'); |
| 124 | 124 | $holder.removeClass('empty').show(); |
diff --git wp-includes/media.php wp-includes/media.php
index dfcb62c..f41f63e 100644
|
|
|
function get_the_image( $attached_size = 'full', &$post = null ) { |
| 2367 | 2367 | if ( isset( $post->format_content ) ) |
| 2368 | 2368 | return $post->format_content; |
| 2369 | 2369 | |
| | 2370 | $meta = get_post_format_meta( $post->ID ); |
| | 2371 | if ( ! empty( $meta['image'] ) ) { |
| | 2372 | $post->format_content = wp_get_attachment_image( $meta['image'], $attached_size ); |
| | 2373 | return $post->format_content; |
| | 2374 | } |
| | 2375 | |
| 2370 | 2376 | $medias = get_attached_images(); |
| 2371 | 2377 | if ( ! empty( $medias ) ) { |
| 2372 | 2378 | $media = reset( $medias ); |
diff --git wp-includes/post-formats.php wp-includes/post-formats.php
index 5c34774..528dcfa 100644
|
|
|
function post_formats_compat( $content, $id = 0 ) { |
| 308 | 308 | $show_content = true; |
| 309 | 309 | $format_output = ''; |
| 310 | 310 | $meta = get_post_format_meta( $post->ID ); |
| 311 | | // passed by ref in preg_match() |
| 312 | | $matches = array(); |
| 313 | 311 | |
| 314 | 312 | switch ( $format ) { |
| 315 | 313 | case 'link': |
| … |
… |
function post_formats_compat( $content, $id = 0 ) { |
| 341 | 339 | } |
| 342 | 340 | break; |
| 343 | 341 | |
| | 342 | case 'image': |
| | 343 | if ( ! empty( $meta['image'] ) ) { |
| | 344 | $image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image']; |
| | 345 | |
| | 346 | if ( ! empty( $image ) && ! stristr( $content, $image ) ) { |
| | 347 | $image_html = sprintf( |
| | 348 | '<img %ssrc="%s" alt="" />', |
| | 349 | empty( $compat['image_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['image_class'] ) ), |
| | 350 | $image |
| | 351 | ); |
| | 352 | if ( empty( $meta['url'] ) ) { |
| | 353 | $format_output .= $image_html; |
| | 354 | } else { |
| | 355 | $format_output .= sprintf( |
| | 356 | '<a href="%s">%s</a>', |
| | 357 | esc_url( $meta['url'] ), |
| | 358 | $image_html |
| | 359 | ); |
| | 360 | } |
| | 361 | } |
| | 362 | } |
| | 363 | break; |
| | 364 | |
| 344 | 365 | case 'quote': |
| 345 | 366 | if ( ! empty( $meta['quote'] ) && ! stristr( $content, $meta['quote'] ) ) { |
| 346 | 367 | $quote = sprintf( '<blockquote>%s</blockquote>', wpautop( $meta['quote'] ) ); |
| 347 | 368 | if ( ! empty( $meta['quote_source'] ) ) { |
| 348 | | $source = ( empty( $quote_meta['url'] ) ) ? $meta['quote_source'] : sprintf( '<a href="%s">%s</a>', esc_url( $meta['url'] ), $meta['quote_source'] ); |
| | 369 | $source = ( empty( $meta['url'] ) ) ? $meta['quote_source'] : sprintf( '<a href="%s">%s</a>', esc_url( $meta['url'] ), $meta['quote_source'] ); |
| 349 | 370 | $quote .= sprintf( '<figcaption class="quote-caption">%s</figcaption>', $source ); |
| 350 | 371 | } |
| 351 | 372 | $format_output .= sprintf( '<figure class="quote">%s</figure>', $quote ); |