usermeta WHERE meta_key = '{$wpdb->prefix}user_level'") ) {
//log_mem_usage_rs( 'start flt_editable_user_ids()' );
if ( ! $post_type = cr_find_post_type() )
return $query;
if ( ! $post_type_obj = get_post_type_object( $post_type ) )
return $query;
$object_id = scoper_get_object_id();
// only modify the default authors list if current user can edit_others for the current post/page
if ( current_user_can( $post_type_obj->cap->edit_others_posts, $object_id ) ) {
global $scoper, $current_user;
$users = $scoper->users_who_can($post_type_obj->cap->edit_posts, COL_ID_RS, 'post', $object_id );
if ( ! in_array($current_user->ID, $users) )
$users []= $current_user->ID;
$query = "SELECT $wpdb->users.ID FROM $wpdb->users WHERE ID IN ('" . implode("','", $users) . "')";
}
//log_mem_usage_rs( 'end flt_editable_user_ids()' );
}
}
return $query;
}
//horrible reverse engineering of dropdown_users execution because only available filter is on html output
function flt_wp_dropdown_users($wp_output) {
//log_mem_usage_rs( 'start flt_wp_dropdown_users()' );
// this is meant to filter the post author selection
if ( ! is_admin() )
return $wp_output;
// if (even after our blogcap tinkering) the author list is already locked due to insufficient blog-wide caps, don't mess
if ( ! $pos = strpos ($wp_output, '', $pos);
if ( $pos_close)
$show_option_all = substr($wp_output, $pos + strlen($search), $pos_close - $pos - strlen($search));
}
$search = "', $pos);
if ( $pos_close)
$show_option_none = substr($wp_output, $pos + strlen($search), $pos_close - $pos - strlen($search));
}
$search = "