Make WordPress Core


Ignore:
Timestamp:
08/27/2010 12:18:57 AM (14 years ago)
Author:
scribu
Message:

use get_users() in get_editable_user_ids() and cache result. See #14572

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r15183 r15539  
    150150
    151151if ( post_type_supports($post_type, 'author') ) {
    152     $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
    153     if ( $post->post_author && !in_array($post->post_author, $authors) )
    154         $authors[] = $post->post_author;
    155     if ( ( $authors && count( $authors ) > 1 ) || is_super_admin() )
     152    $_editable_user_ids = get_editable_user_ids( $current_user->id, true, $post_type ); // TODO: ROLE SYSTEM
     153    if ( $post->post_author && !in_array($post->post_author, $_editable_user_ids) )
     154        $_editable_user_ids[] = $post->post_author;
     155
     156    if ( !empty($_editable_user_ids) || is_super_admin() )
    156157        add_meta_box('authordiv', __('Author'), 'post_author_meta_box', $post_type, 'normal', 'core');
    157158}
Note: See TracChangeset for help on using the changeset viewer.