Ticket #22743: 22743.4.diff
File 22743.4.diff, 7.4 KB (added by , 12 years ago) |
---|
-
wp-includes/media.php
1337 1337 'update' => false, 1338 1338 'delete' => false, 1339 1339 ), 1340 'editLink' => false, 1340 1341 ); 1341 1342 1342 if ( current_user_can( 'edit_post', $attachment->ID ) ) 1343 if ( current_user_can( 'edit_post', $attachment->ID ) ) { 1343 1344 $response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID ); 1345 $response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' ); 1346 } 1344 1347 1345 1348 if ( current_user_can( 'delete_post', $attachment->ID ) ) 1346 1349 $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID ); … … 1696 1699 <# if ( 'image' === data.type && ! data.uploading && data.width && data.height ) { #> 1697 1700 <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 1698 1701 <# } #> 1699 <# if ( ! data.uploading && data.can.remove ) { #> 1700 <div class="delete-attachment"> 1701 <a href="#"><?php _e( 'Delete Permanently' ); ?></a> 1702 </div> 1702 <# if ( ! data.uploading && ( data.can.save || data.can.remove ) ) { #> 1703 <div class="modify-attachment"> 1704 <# if ( data.can.save ) { #> 1705 <span class="edit-attachment"> 1706 <a href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> 1707 </span> 1708 <# } #> 1709 <# if ( data.can.remove ) { #> 1710 <span class="delete-attachment"> 1711 <a href="#"><?php _e( 'Delete Permanently' ); ?></a> 1712 </span> 1713 <# } #> 1703 1714 <# } #> 1704 1715 <div class="compat-meta"> 1705 1716 <# if ( data.compat && data.compat.meta ) { #> -
wp-includes/css/media-views-rtl.css
259 259 float: right; 260 260 } 261 261 262 .attachment-info .modify-attachment span { 263 margin-right: 0; 264 margin-left: 10px; 265 } 266 267 .attachment-info .modify-attachment span:last-child { 268 margin-left: 0; 269 } 270 262 271 /** 263 272 * Attachment Display Settings 264 273 */ -
wp-includes/css/media-views.css
1326 1326 float: left; 1327 1327 font-size: 12px; 1328 1328 max-width: 100%; 1329 margin-bottom: 13px; 1329 1330 } 1330 1331 1331 .attachment-info .delete-attachment a { 1332 color: red; 1333 padding: 2px 4px; 1334 margin: -2px -4px; 1332 .attachment-info .modify-attachment span { 1333 display: block; 1334 } 1335 1336 .attachment-info .modify-attachment span:last-child { 1337 margin-right: 0; 1338 } 1339 1340 .attachment-info .modify-attachment span a { 1335 1341 text-decoration: none; 1336 1342 white-space: nowrap; 1337 1343 } 1338 1344 1345 .attachment-info .delete-attachment a { 1346 color: #bc0b0b; 1347 } 1348 1339 1349 .attachment-info .delete-attachment a:hover { 1340 color: #fff; 1341 background: red; 1350 color: red; 1342 1351 } 1343 1352 1344 1353 /** -
wp-admin/includes/ajax-actions.php
1837 1837 wp_send_json_error(); 1838 1838 1839 1839 $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array(); 1840 1840 1841 $query = array_intersect_key( $query, array_flip( array( 1841 1842 's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type', 1842 'post_parent', 'post__in', 'post__not_in', 1843 'post_parent', 'post__in', 'post__not_in', '_query_attachments_post_modified_gmt_since' 1843 1844 ) ) ); 1844 1845 1845 1846 $query['post_type'] = 'attachment'; … … 1847 1848 if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) ) 1848 1849 $query['post_status'] .= ',private'; 1849 1850 1851 add_filter( 'posts_where', '_query_attachments_post_modified_gmt_since', 10, 2 ); 1850 1852 $query = new WP_Query( $query ); 1853 remove_filter( 'posts_where', '_query_attachments_post_modified_gmt_since', 10 ); 1851 1854 1852 1855 $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts ); 1853 1856 $posts = array_filter( $posts ); … … 1855 1858 wp_send_json_success( $posts ); 1856 1859 } 1857 1860 1861 function _query_attachments_post_modified_gmt_since( $where, $query ) { 1862 global $wpdb; 1863 1864 if ( $modified_since = absint( $query->get('_query_attachments_post_modified_gmt_since') ) ) { 1865 $modified_since = gmdate( 'Y-m-d H:i:s', $modified_since ); 1866 $where .= $wpdb->prepare( " AND $wpdb->posts.post_modified_gmt > %s", $modified_since ); 1867 } 1868 1869 return $where; 1870 } 1871 1858 1872 /** 1859 1873 * Save attachment attributes. 1860 1874 * -
wp-admin/includes/image-edit.php
191 191 </td></tr> 192 192 </tbody></table> 193 193 <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div> 194 <script type="text/javascript"> imageEdit.init(<?php echo $post_id; ?>);</script>194 <script type="text/javascript">jQuery( function() { imageEdit.init(<?php echo $post_id; ?>); });</script> 195 195 <div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e("There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor."); ?></div> 196 196 </div> 197 197 <?php -
wp-admin/includes/media.php
2262 2262 function edit_form_image_editor() { 2263 2263 $post = get_post(); 2264 2264 2265 $open = isset( $_GET['image-editor'] ); 2266 if ( $open ) 2267 require_once ABSPATH . 'wp-admin/includes/image-edit.php'; 2268 2265 2269 $thumb_url = false; 2266 2270 if ( $attachment_id = intval( $post->ID ) ) 2267 $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 600 ), true );2271 $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true ); 2268 2272 2269 2273 $filename = esc_html( basename( $post->guid ) ); 2270 2274 $title = esc_attr( $post->post_title ); 2271 2275 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 2272 2276 2273 $media_dims = '';2274 $meta = wp_get_attachment_metadata( $post->ID );2275 if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) )2276 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> ";2277 $media_dims = apply_filters( 'media_meta', $media_dims, $post );2278 2279 2277 $att_url = wp_get_attachment_url( $post->ID ); 2280 2278 2281 2279 $image_edit_button = ''; … … 2288 2286 <div class="wp_attachment_holder"> 2289 2287 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> 2290 2288 2291 <div class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>">2289 <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>"> 2292 2290 <p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p> 2293 2291 <p><?php echo $image_edit_button; ?></p> 2294 2292 </div> 2295 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2293 <div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"> 2294 <?php if ( $open ) wp_image_editor( $attachment_id ); ?> 2295 </div> 2296 2296 </div> 2297 2297 2298 2298 <div class="wp_attachment_details">