Changeset 4348
- Timestamp:
- 10/06/2006 12:34:58 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-functions.php
r4340 r4348 13 13 14 14 $class = 'text'; 15 $thumb_src = ''; 15 16 $innerHTML = get_attachment_innerHTML( $id, false, $dims ); 16 17 if ( $image_src = strstr($innerHTML, 'src="') ) { 17 18 $image_src = explode('"', $image_src); 18 19 $image_src = $image_src[1]; 20 $thumb_src = wp_make_link_relative($image_src); 19 21 $class = 'image'; 20 $innerHTML = ' ' . $innerHTML;22 $innerHTML = ' ' . str_replace($image_src, $thumb_src, $innerHTML); 21 23 } 24 25 $src = wp_make_link_relative( get_the_guid() ); 22 26 23 27 $r = ''; … … 30 34 $r .= "</a>\n"; 31 35 $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; 32 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value=' " . get_the_guid() . "' />\n";36 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n"; 33 37 34 38 if ( $image_src ) 35 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$ image_src' />\n";39 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$thumb_src' />\n"; 36 40 if ( isset($width) ) { 37 41 $r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n"; -
trunk/wp-includes/formatting.php
r4320 r4348 1071 1071 } 1072 1072 1073 function wp_make_link_relative( $link, $base = '' ) { 1074 if ( !$base ) 1075 $base = get_option( 'home' ); 1076 if ( 0 === strpos($link, $base) ) 1077 $link = substr_replace($link, '', 0, strlen($base)); 1078 return $link; 1079 } 1073 1080 ?>
Note: See TracChangeset
for help on using the changeset viewer.