Make WordPress Core

Changeset 21957


Ignore:
Timestamp:
09/23/2012 06:39:03 PM (13 years ago)
Author:
nacin
Message:

Check a post type's show_in_admin_bar property for 'View' and 'Edit' object links. Previously show_in_admin_bar was only checked for the add new menu. fixes #20504.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r21948 r21957  
    430430            && ( $post_type_object = get_post_type_object( $post->post_type ) )
    431431            && current_user_can( $post_type_object->cap->read_post, $post->ID )
    432             && ( $post_type_object->public ) )
     432            && ( $post_type_object->public )
     433            && ( $post_type_object->show_in_admin_bar ) )
    433434        {
    434435            $wp_admin_bar->add_menu( array(
     
    457458            && ( $post_type_object = get_post_type_object( $current_object->post_type ) )
    458459            && current_user_can( $post_type_object->cap->edit_post, $current_object->ID )
    459             && ( $post_type_object->show_ui || 'attachment' == $current_object->post_type ) )
     460            && $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
    460461        {
    461462            $wp_admin_bar->add_menu( array(
Note: See TracChangeset for help on using the changeset viewer.