WordPress.org

Make WordPress Core

Changeset 25140


Ignore:
Timestamp:
08/27/2013 08:48:40 PM (5 years ago)
Author:
nacin
Message:

Don't create an edit link to a non-UI post type in the media list table.

props johnbillion.
fixes #20453.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r24396 r25140  
    302302
    303303    case 'parent':
    304         if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) {
     304        if ( $post->post_parent > 0 )
     305            $parent = get_post( $post->post_parent );
     306        else
     307            $parent = false;
     308
     309        if ( $parent ) {
    305310            $title = _draft_or_post_title( $post->post_parent );
     311            $parent_type = get_post_type_object( $parent->post_type );
    306312?>
    307313            <td <?php echo $attributes ?>><strong>
    308                 <?php if ( current_user_can( 'edit_post', $post->post_parent ) ) { ?>
     314                <?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type->show_ui ) { ?>
    309315                    <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
    310316                        <?php echo $title ?></a><?php
Note: See TracChangeset for help on using the changeset viewer.