WordPress.org

Make WordPress Core

Ticket #22247: 22247.diff

File 22247.diff, 617 bytes (added by Joe Anzalone, 18 months ago)
  • wp-includes/admin-bar.php

     
    454454                if ( empty( $current_object ) ) 
    455455                        return; 
    456456 
    457                 if ( ! empty( $current_object->post_type ) 
     457                if ( ! empty( $current_object->post_type ) && $current_object->ID 
    458458                        && ( $post_type_object = get_post_type_object( $current_object->post_type ) ) 
    459459                        && current_user_can( $post_type_object->cap->edit_post, $current_object->ID ) 
    460460                        && $post_type_object->show_ui && $post_type_object->show_in_admin_bar )