Skip to content

Commit

Permalink
Don't create an edit link to a non-UI post type in the media list table.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nacin committed Aug 27, 2013
1 parent 41f1cd6 commit aa6d5dd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wp-admin/includes/class-wp-media-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,17 @@ function display_rows() {
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 {
Expand Down

0 comments on commit aa6d5dd

Please sign in to comment.