]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-media-list-table.php
WordPress 3.8.1-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-media-list-table.php
index 67fd187cf6d8956ab609d0574239d966a8d46e9e..1f0067dd8ae2b16f8c78a564812426f7a74d7021 100644 (file)
@@ -301,11 +301,17 @@ foreach ( $columns as $column_name => $column_display_name ) {
                break;
 
        case 'parent':
-               if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) {
+               if ( $post->post_parent > 0 )
+                       $parent = get_post( $post->post_parent );
+               else
+                       $parent = false;
+
+               if ( $parent ) {
                        $title = _draft_or_post_title( $post->post_parent );
+                       $parent_type = get_post_type_object( $parent->post_type );
 ?>
                        <td <?php echo $attributes ?>><strong>
-                               <?php if ( current_user_can( 'edit_post', $post->post_parent ) ) { ?>
+                               <?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type->show_ui ) { ?>
                                        <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
                                                <?php echo $title ?></a><?php
                                } else {