[wpmu-trac] [WordPress MU Trac] #1093: Post/page author dropdown field not displayed on edit post/page screen for site admins
WordPress MU Trac
wpmu-trac at lists.automattic.com
Fri Sep 11 20:28:03 UTC 2009
#1093: Post/page author dropdown field not displayed on edit post/page screen for
site admins
----------------------------+-----------------------------------------------
Reporter: jamescollins | Owner: somebody
Type: defect | Status: new
Priority: high | Milestone:
Component: Administration | Version:
Severity: major | Keywords:
----------------------------+-----------------------------------------------
Comment(by deannas):
I think the problem lies in wp-admin\includes\user.php. I think the
function get_editable_user_ids should be rearranged so that the site admin
part of the function happens first, and the admin should always be in the
drop down if it's an admin editing the page or post. Anyone want to try
the following function instead? (Function starts on line 247.)
{{{
function get_editable_user_ids( $user_id, $exclude_zeros = true,
$post_type = 'post' ) {
global $wpdb;
$user = new WP_User( $user_id );
if (is_site_admin()) {
$level_key = $wpdb->prefix . 'capabilities'; // wpmu site
admins don't have user_levels
$query = $wpdb->prepare("SELECT user_id FROM
$wpdb->usermeta WHERE meta_key = %s", $level_key);
if ( $exclude_zeros )
$query .= " AND meta_value !=
'a:1:{s:10:\"subscriber\";b:1;}'";
$return = $wpdb->get_col( $query );
if (is_site_admin()) {
array_push($return, $user_id);
}
return $return;
}
if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
if ( $user->has_cap("edit_{$post_type}s") ||
$exclude_zeros == false )
return array($user->id);
else {
return array();
}
}
}
}}}
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/1093#comment:7>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list