Make WordPress Core

Changeset 27560


Ignore:
Timestamp:
03/17/2014 03:32:32 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Avoid PHP notices in Media Library if an attachment parent post type no longer exists.

props wpsmith.
fixes #27439.

File:
1 edited

Legend:

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

    r27548 r27560  
    330330?>
    331331            <td <?php echo $attributes ?>><strong>
    332                 <?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type->show_ui ) { ?>
     332                <?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type && $parent_type->show_ui ) { ?>
    333333                    <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
    334334                        <?php echo $title ?></a><?php
Note: See TracChangeset for help on using the changeset viewer.