Changes in trunk/wp-includes/media.php [16865:15003]
- File:
-
- 1 edited
-
trunk/wp-includes/media.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r16865 r15003 138 138 $width = $height = 0; 139 139 $is_intermediate = false; 140 $img_url_basename = wp_basename($img_url);141 140 142 141 // plugins can use this to provide resize services … … 146 145 // try for a new style intermediate size 147 146 if ( $intermediate = image_get_intermediate_size($id, $size) ) { 148 $img_url = str_replace( $img_url_basename, $intermediate['file'], $img_url);147 $img_url = str_replace(basename($img_url), $intermediate['file'], $img_url); 149 148 $width = $intermediate['width']; 150 149 $height = $intermediate['height']; … … 154 153 // fall back to the old thumbnail 155 154 if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { 156 $img_url = str_replace( $img_url_basename, wp_basename($thumb_file), $img_url);155 $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url); 157 156 $width = $info[0]; 158 157 $height = $info[1]; … … 179 178 * Registers a new image size 180 179 */ 181 function add_image_size( $name, $width = 0, $height = 0, $crop = false) {180 function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) { 182 181 global $_wp_additional_image_sizes; 183 $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => (bool)$crop );182 $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop ); 184 183 } 185 184 … … 187 186 * Registers an image size for the post thumbnail 188 187 */ 189 function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false) {188 function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) { 190 189 add_image_size( 'post-thumbnail', $width, $height, $crop ); 191 190 } … … 438 437 $dir = $info['dirname']; 439 438 $ext = $info['extension']; 440 $name = wp_basename($file, ".$ext"); 441 439 $name = basename($file, ".{$ext}"); 442 440 if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) ) 443 441 $dir = $_dest_path; … … 488 486 $resized_file = apply_filters('image_make_intermediate_size', $resized_file); 489 487 return array( 490 'file' => wp_basename( $resized_file ),488 'file' => basename( $resized_file ), 491 489 'width' => $info[0], 492 490 'height' => $info[1], … … 609 607 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 610 608 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 611 $src_file = $icon_dir . '/' . wp_basename($src);609 $src_file = $icon_dir . '/' . basename($src); 612 610 @list($width, $height) = getimagesize($src_file); 613 611 } … … 824 822 $selector = "gallery-{$instance}"; 825 823 826 $gallery_style = $gallery_div = ''; 827 if ( apply_filters( 'use_default_gallery_style', true ) ) 828 $gallery_style = " 824 $output = apply_filters('gallery_style', " 829 825 <style type='text/css'> 830 826 #{$selector} { … … 835 831 margin-top: 10px; 836 832 text-align: center; 837 width: {$itemwidth}%; 838 } 833 width: {$itemwidth}%; } 839 834 #{$selector} img { 840 835 border: 2px solid #cfcfcf; … … 844 839 } 845 840 </style> 846 <!-- see gallery_shortcode() in wp-includes/media.php -->"; 847 $size_class = sanitize_html_class( $size ); 848 $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; 849 $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div ); 841 <!-- see gallery_shortcode() in wp-includes/media.php --> 842 <div id='$selector' class='gallery galleryid-{$id}'>"); 850 843 851 844 $i = 0; … … 860 853 if ( $captiontag && trim($attachment->post_excerpt) ) { 861 854 $output .= " 862 <{$captiontag} class=' wp-caption-textgallery-caption'>855 <{$captiontag} class='gallery-caption'> 863 856 " . wptexturize($attachment->post_excerpt) . " 864 857 </{$captiontag}>"; … … 968 961 * @since 2.9.0 969 962 * 970 * @param string $mime_type963 * @param $mime_type string 971 964 * @return bool 972 965 */ … … 999 992 * @since 2.9.0 1000 993 * 1001 * @param int $width Imagewidth1002 * @param int $height Imageheight994 * @param $width 995 * @param $height 1003 996 * @return image resource 1004 997 */ … … 1071 1064 global $shortcode_tags; 1072 1065 1073 // Back up current registered shortcodes and clear them all out1066 // Backup current registered shortcodes and clear them all out 1074 1067 $orig_shortcode_tags = $shortcode_tags; 1075 1068 remove_all_shortcodes(); … … 1164 1157 $attr = wp_parse_args( $attr, wp_embed_defaults() ); 1165 1158 1166 // kses converts & into & and we need to undo this1167 // See http://core.trac.wordpress.org/ticket/113111168 $url = str_replace( '&', '&', $url );1169 1170 1159 // Look for known internal handlers 1171 1160 ksort( $this->handlers ); … … 1196 1185 1197 1186 if ( !empty($cache) ) 1198 return apply_filters( 'embed_oembed_html', $cache, $url, $attr , $post_ID);1187 return apply_filters( 'embed_oembed_html', $cache, $url, $attr ); 1199 1188 } 1200 1189 … … 1209 1198 // If there was a result, return it 1210 1199 if ( $html ) 1211 return apply_filters( 'embed_oembed_html', $html, $url, $attr , $post_ID);1200 return apply_filters( 'embed_oembed_html', $html, $url, $attr ); 1212 1201 } 1213 1202
Note: See TracChangeset
for help on using the changeset viewer.