Make WordPress Core

Changeset 10285


Ignore:
Timestamp:
12/31/2008 05:40:05 PM (16 years ago)
Author:
ryan
Message:

phpdoc for wp_dropdown_roles(). Add role_names_listing filter. Props jeremyclarke. fixes #8761

File:
1 edited

Legend:

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

    r10268 r10285  
    25872587}
    25882588
    2589 /**
    2590  * {@internal Missing Short Description}}
    2591  *
    2592  * @since unknown
    2593  *
    2594  * @param unknown_type $default
    2595  */
    2596 function wp_dropdown_roles( $default = false ) {
     2589 
     2590/**
     2591 * Print out <option> html elements for role selectors based on $wp_roles
     2592 *
     2593 * @package WordPress
     2594 * @subpackage Administration
     2595 * @since 2.1
     2596 *
     2597 * @uses $wp_roles
     2598 * @param string $default slug for the role that should be already selected
     2599 */
     2600function wp_dropdown_roles( $selected = false ) {
    25972601    global $wp_roles;
    25982602    $p = '';
    25992603    $r = '';
    2600     foreach( $wp_roles->role_names as $role => $name ) {
     2604   
     2605    $role_names = $wp_roles->role_names;
     2606    $role_names = apply_filters('role_names_listing', $role_names);
     2607   
     2608    foreach( $role_names as $role => $name ) {
    26012609        $name = translate_with_context($name);
    2602         if ( $default == $role ) // Make default first in list
     2610        if ( $selected == $role ) // Make default first in list
    26032611            $p = "\n\t<option selected='selected' value='$role'>$name</option>";
    26042612        else
Note: See TracChangeset for help on using the changeset viewer.