Make WordPress Core

Ticket #55071: 55071.diff

File 55071.diff, 2.9 KB (added by rafiahmedd, 3 years ago)

Modify as suggested

  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 81944eda0e..994942445a 100644
    a b function get_users( $args = array() ) { 
    770770 *
    771771 * @since 5.9.0
    772772 *
    773  * @param string|array $args {
    774  *     Optional. Array or string of default arguments.
    775  *
    776  *     @type string $orderby       How to sort the users. Accepts 'nicename', 'email', 'url', 'registered',
    777  *                                 'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',
    778  *                                 'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.
    779  *     @type string $order         Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.
    780  *     @type int    $number        Maximum users to return or display. Default empty (all users).
    781  *     @type bool   $exclude_admin Whether to exclude the 'admin' account, if it exists. Default false.
    782  *     @type bool   $show_fullname Whether to show the user's full name. Default false.
    783  *     @type string $feed          If not empty, show a link to the user's feed and use this text as the alt
    784  *                                 parameter of the link. Default empty.
    785  *     @type string $feed_image    If not empty, show a link to the user's feed and use this image URL as
    786  *                                 clickable anchor. Default empty.
    787  *     @type string $feed_type     The feed type to link to, such as 'rss2'. Defaults to default feed type.
    788  *     @type bool   $echo          Whether to output the result or instead return it. Default true.
    789  *     @type string $style         If 'list', each user is wrapped in an `<li>` element, otherwise the users
    790  *                                 will be separated by commas.
    791  *     @type bool   $html          Whether to list the items in HTML form or plaintext. Default true.
    792  *     @type string $exclude       An array, comma-, or space-separated list of user IDs to exclude. Default empty.
    793  *     @type string $include       An array, comma-, or space-separated list of user IDs to include. Default empty.
    794  * }
     773 * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query()
     774 *                    for more information on accepted arguments.
    795775 * @return string|null The output if echo is false. Otherwise null.
    796776 */
    797777function wp_list_users( $args = array() ) {
    function wp_list_users( $args = array() ) { 
    812792        );
    813793
    814794        $args = wp_parse_args( $args, $defaults );
     795        apply_filters( 'wp_list_users', $args );
    815796
    816797        $return = '';
    817798
    function wp_list_users( $args = array() ) { 
    827808                }
    828809
    829810                if ( $args['show_fullname'] && '' !== $user->first_name && '' !== $user->last_name ) {
    830                         $name = "$user->first_name $user->last_name";
     811                        $full_name = "$user->first_name $user->last_name";
     812                        $name = apply_filters( 'wp_list_users_fullname', $full_name, $user, $args );
    831813                } else {
    832814                        $name = $user->display_name;
    833815                }