Ticket #6116: 7174-custom-header.diff
File 7174-custom-header.diff, 1.3 KB (added by , 16 years ago) |
---|
-
wp-admin/custom-header.php
215 215 $file = $file['file']; 216 216 $filename = basename($file); 217 217 218 // Get current theme 219 $ct = current_theme_info(); 220 218 221 // Construct the object array 219 222 $object = array( 220 'post_title' => $filename, 221 'post_content' => $url, 222 'post_mime_type' => $type, 223 'guid' => $url); 223 'post_title' => $filename, 224 'post_content' => $url, 225 'post_excerpt' => sprintf( __('Custom Header Image for %1$s (%2$d x %3$d)'), $ct->title, HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT ), 226 'post_mime_type' => $type, 227 'guid' => $url 228 ); 224 229 225 230 // Save the data 226 231 $id = wp_insert_attachment($object, $file); … … 292 297 $parent_url = $parent->guid; 293 298 $url = str_replace(basename($parent_url), basename($cropped), $parent_url); 294 299 300 // Get current theme 301 $ct = current_theme_info(); 302 295 303 // Construct the object array 296 304 $object = array( 297 305 'ID' => $_POST['attachment_id'], 298 306 'post_title' => basename($cropped), 299 307 'post_content' => $url, 308 'post_excerpt' => sprintf( __('Custom Header Image for %1$s (%2$d x %3$d)'), $ct->title, HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT ), 300 309 'post_mime_type' => 'image/jpeg', 301 310 'guid' => $url 302 311 );