WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/27/2010 12:22:29 AM (11 years ago)
Author:
scribu
Message:

Deprecate unused get_author_user_ids()and get_editable_authors(). See #14572

File:
1 edited

Legend:

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

    r15519 r15540  
    198198}
    199199
     200
     201/**
     202 * @deprecated 3.1.0
     203 *
     204 * @return array List of user IDs.
     205 */
     206function get_author_user_ids() {
     207    _deprecated_function( __FUNCTION__, '3.1' );
     208
     209    global $wpdb;
     210    if ( !is_multisite() )
     211        $level_key = $wpdb->get_blog_prefix() . 'user_level';
     212    else
     213        $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
     214
     215    return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
     216}
     217
     218/**
     219 * @deprecated 3.1.0
     220 *
     221 * @param int $user_id User ID.
     222 * @return array|bool List of editable authors. False if no editable users.
     223 */
     224function get_editable_authors( $user_id ) {
     225    _deprecated_function( __FUNCTION__, '3.1' );
     226
     227    global $wpdb;
     228
     229    $editable = get_editable_user_ids( $user_id );
     230
     231    if ( !$editable ) {
     232        return false;
     233    } else {
     234        $editable = join(',', $editable);
     235        $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
     236    }
     237
     238    return apply_filters('get_editable_authors', $authors);
     239}
     240
    200241/**
    201242 * Register column headers for a particular screen.
Note: See TracChangeset for help on using the changeset viewer.