Ticket #12208: 12208.diff
File 12208.diff, 5.1 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/class-wp-media-list-table.php
7 7 * @since 3.1.0 8 8 * @access private 9 9 */ 10 class WP_Media_List_Table extends WP_ List_Table {10 class WP_Media_List_Table extends WP_Posts_List_Table { 11 11 12 12 function __construct( $args = array() ) { 13 13 $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] ); … … 174 174 ); 175 175 } 176 176 177 function display_rows( ) {177 function display_rows( $posts = array(), $level = 0 ) { 178 178 global $post; 179 179 180 180 add_filter( 'the_title','esc_html' ); … … 398 398 $actions = array(); 399 399 400 400 if ( $this->detached ) { 401 if ( current_user_can( 'edit_post', $post->ID ) ) 401 if ( current_user_can( 'edit_post', $post->ID ) ) { 402 402 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>'; 403 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; 404 } 405 403 406 if ( current_user_can( 'delete_post', $post->ID ) ) 404 407 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { 405 408 $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; … … 412 415 $actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\''.$post->ID.'\' );return false;" class="hide-if-no-js">'.__( 'Attach' ).'</a>'; 413 416 } 414 417 else { 415 if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash ) 418 if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash ) { 416 419 $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>'; 420 $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; 421 } 417 422 if ( current_user_can( 'delete_post', $post->ID ) ) { 418 423 if ( $this->is_trash ) 419 424 $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; -
src/wp-admin/includes/class-wp-posts-list-table.php
54 54 ) ); 55 55 56 56 $post_type = $this->screen->post_type; 57 $post_type_object = get_post_type_object( $post_type);57 $post_type_object = get_post_type_object( 'attachment' ); 58 58 59 59 if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { 60 60 $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false ) ); … … 81 81 function prepare_items() { 82 82 global $avail_post_stati, $wp_query, $per_page, $mode; 83 83 84 $avail_post_stati = wp_edit_posts_query(); 84 if ( 'attachment' == $this->screen->post_type ) { 85 $avail_post_stati = wp_edit_attachments_query(); 86 } else { 87 $avail_post_stati = wp_edit_posts_query(); 88 } 85 89 86 90 $this->hierarchical_display = ( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' == $wp_query->query['orderby'] ); 87 91 -
src/wp-admin/includes/list-table.php
21 21 $core_classes = array( 22 22 //Site Admin 23 23 'WP_Posts_List_Table' => 'posts', 24 'WP_Media_List_Table' => 'media',24 'WP_Media_List_Table' => array( 'posts', 'media' ), 25 25 'WP_Terms_List_Table' => 'terms', 26 26 'WP_Users_List_Table' => 'users', 27 27 'WP_Comments_List_Table' => 'comments', -
src/wp-admin/includes/screen.php
506 506 507 507 $id = 'edit-' . $taxonomy; 508 508 break; 509 case 'upload' : 510 $post_type = 'attachment'; 511 break; 509 512 } 510 513 511 514 if ( 'network' == $in_admin ) { -
src/wp-admin/upload.php
12 12 if ( !current_user_can('upload_files') ) 13 13 wp_die( __( 'You do not have permission to upload files.' ) ); 14 14 15 $wp_list_table = _get_list_table('WP_Media_List_Table'); 15 $post_type_object = get_post_type_object( 'attachment' ); 16 17 $wp_list_table = _get_list_table('WP_Posts_List_Table'); 16 18 $pagenum = $wp_list_table->get_pagenum(); 17 19 20 wp_enqueue_script('inline-edit-post'); 21 18 22 // Handle bulk actions 19 23 $doaction = $wp_list_table->current_action(); 20 24 … … 247 251 </div> 248 252 249 253 <?php 254 if ( $wp_list_table->has_items() ) 255 $wp_list_table->inline_edit(); 256 ?> 257 258 <?php 250 259 include( ABSPATH . 'wp-admin/admin-footer.php' );