WordPress.org

Make WordPress Core

Changeset 35610


Ignore:
Timestamp:
11/11/2015 07:27:11 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Users: Add user's Gravatar to 'About the user' section on user profile page.

Add user_profile_picture_description filter for the description text displayed under the Gravatar.

Props carolinegeven, obrienlabs, SergeyBiryukov.
Fixes #32286.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r34912 r35610  
    436436    <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea>
    437437    <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p></td>
     438</tr>
     439
     440<tr class="user-profile-picture">
     441    <th><?php _e( 'Profile Picture' ); ?></th>
     442    <td>
     443        <?php echo get_avatar( $user_id ); ?>
     444        <p class="description"><?php
     445            if ( IS_PROFILE_PAGE ) {
     446                /* translators: %s: Gravatar URL */
     447                $description = sprintf( __( 'You can change your profile picture on <a href="%s">Gravatar</a>.' ),
     448                    __( 'https://en.gravatar.com/' )
     449                );
     450            } else {
     451                $description = '';
     452            }
     453
     454            /**
     455             * Filter the user profile picture description displayed under the Gravatar.
     456             *
     457             * @since 4.4.0
     458             *
     459             * @param string $description The description that will be printed.
     460             */
     461            echo apply_filters( 'user_profile_picture_description', $description );
     462        ?></p>
     463    </td>
    438464</tr>
    439465
Note: See TracChangeset for help on using the changeset viewer.