WordPress.org

Make WordPress Core

Changeset 15540


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

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

Location:
trunk/wp-admin/includes
Files:
2 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.
  • trunk/wp-admin/includes/user.php

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