- return $wpdb->get_col( $query );
-}
-
-function get_nonauthor_user_ids() {
- global $wpdb;
- $level_key = $wpdb->prefix . 'user_level';
-
- return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
-}
-
-function get_others_unpublished_posts($user_id, $type='any') {
- global $wpdb;
-
- $editable = get_editable_user_ids( $user_id );
-
- if ( in_array($type, array('draft', 'pending')) )
- $type_sql = " post_status = '$type' ";
- else
- $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
-
- $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
-
- if( !$editable ) {
- $other_unpubs = '';
- } else {
- $editable = join(',', $editable);
- $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
- }
-
- return apply_filters('get_others_drafts', $other_unpubs);
-}
-
-function get_others_drafts($user_id) {
- return get_others_unpublished_posts($user_id, 'draft');
-}
-
-function get_others_pending($user_id) {
- return get_others_unpublished_posts($user_id, 'pending');
-}
-
-function get_user_to_edit( $user_id ) {
- $user = new WP_User( $user_id );
- $user->user_login = attribute_escape($user->user_login);
- $user->user_email = attribute_escape($user->user_email);
- $user->user_url = clean_url($user->user_url);
- $user->first_name = attribute_escape($user->first_name);
- $user->last_name = attribute_escape($user->last_name);
- $user->display_name = attribute_escape($user->display_name);
- $user->nickname = attribute_escape($user->nickname);
- $user->aim = attribute_escape($user->aim);
- $user->yim = attribute_escape($user->yim);
- $user->jabber = attribute_escape($user->jabber);
- $user->description = wp_specialchars($user->description);