Changes in trunk/wp-includes/media.php [18827:21014]
- File:
-
- 1 edited
-
trunk/wp-includes/media.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r18827 r21014 54 54 } 55 55 elseif ( $size == 'large' ) { 56 // we're inserting a large size image into the editor. if it's a really56 // We're inserting a large size image into the editor. If it's a really 57 57 // big image we'll scale it down to fit reasonably within the editor 58 // itself, and within the theme's content width if it's known. the user58 // itself, and within the theme's content width if it's known. The user 59 59 // can resize it in the editor if they wish. 60 60 $max_width = intval(get_option('large_size_w')); … … 328 328 * 329 329 * @since 2.5.0 330 * @uses apply_filters() Calls 'image_resize_dimensions' on $orig_w, $orig_h, $dest_w, $dest_h and 331 * $crop to provide custom resize dimensions. 330 332 * 331 333 * @param int $orig_w Original width. … … 343 345 if ($dest_w <= 0 && $dest_h <= 0) 344 346 return false; 347 348 // plugins can use this to provide custom resize dimensions 349 $output = apply_filters( 'image_resize_dimensions', null, $orig_w, $orig_h, $dest_w, $dest_h, $crop ); 350 if ( null !== $output ) 351 return $output; 345 352 346 353 if ( $crop ) { … … 456 463 } else { 457 464 // all other formats are converted to jpg 458 $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; 465 if ( 'jpg' != $ext && 'jpeg' != $ext ) 466 $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; 459 467 if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) 460 468 return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); … … 725 733 */ 726 734 function img_caption_shortcode($attr, $content = null) { 735 // New-style shortcode with the caption inside the shortcode with the link and image tags. 736 if ( ! isset( $attr['caption'] ) ) { 737 if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) { 738 $content = $matches[1]; 739 $attr['caption'] = trim( $matches[2] ); 740 } 741 } 727 742 728 743 // Allow plugins/themes to override the default caption template. … … 1097 1112 /* <![CDATA[ */ 1098 1113 jQuery(document).ready(function($){ 1099 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>");1114 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID, 'relative' ); ?>"); 1100 1115 }); 1101 1116 /* ]]> */ … … 1379 1394 * @param string $url The URL that should be embedded. 1380 1395 * @param array $args Additional arguments and parameters. 1381 * @return string The original URLon failure or the embed HTML on success.1396 * @return bool|string False on failure or the embed HTML on success. 1382 1397 */ 1383 1398 function wp_oembed_get( $url, $args = '' ) { … … 1443 1458 } 1444 1459 1445 ?> 1460 /** 1461 * Prints default plupload arguments. 1462 * 1463 * @since 3.4.0 1464 */ 1465 function wp_plupload_default_settings() { 1466 global $wp_scripts; 1467 1468 $max_upload_size = wp_max_upload_size(); 1469 1470 $defaults = array( 1471 'runtimes' => 'html5,silverlight,flash,html4', 1472 'file_data_name' => 'async-upload', // key passed to $_FILE. 1473 'multiple_queues' => true, 1474 'max_file_size' => $max_upload_size . 'b', 1475 'url' => admin_url( 'admin-ajax.php', 'relative' ), 1476 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ), 1477 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ), 1478 'filters' => array( array( 'title' => __( 'Allowed Files' ), 'extensions' => '*') ), 1479 'multipart' => true, 1480 'urlstream_upload' => true, 1481 ); 1482 1483 $defaults = apply_filters( 'plupload_default_settings', $defaults ); 1484 1485 $params = array( 1486 'action' => 'upload-attachment', 1487 ); 1488 1489 $params = apply_filters( 'plupload_default_params', $params ); 1490 $params['_wpnonce'] = wp_create_nonce( 'media-form' ); 1491 $defaults['multipart_params'] = $params; 1492 1493 $settings = array( 1494 'defaults' => $defaults, 1495 'browser' => array( 1496 'mobile' => wp_is_mobile(), 1497 'supported' => _device_can_upload(), 1498 ), 1499 ); 1500 1501 $script = 'var _wpPluploadSettings = ' . json_encode( $settings ) . ';'; 1502 1503 $data = $wp_scripts->get_data( 'wp-plupload', 'data' ); 1504 if ( $data ) 1505 $script = "$data\n$script"; 1506 1507 $wp_scripts->add_data( 'wp-plupload', 'data', $script ); 1508 } 1509 add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)