From aa6d5ddb3e61a77b4e4d0bef2b747f935286c1f0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 27 Aug 2013 20:49:10 +0000 Subject: [PATCH] Don't create an edit link to a non-UI post type in the media list table. props johnbillion. fixes #20453. Built from https://develop.svn.wordpress.org/trunk@25140 git-svn-id: http://core.svn.wordpress.org/trunk@25120 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-media-list-table.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index 67fd187cf6..87aa9f73d2 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -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 ); ?> > - post_parent ) ) { ?> + post_parent ) && $parent_type->show_ui ) { ?>