/** * Render the primary metabox for user profile screen * * @since 0.1.0 * * @param WP_User $user The WP_User object to be edited. */ function wp_user_profiles_avatar_metabox($user = null) { // Bail if no user id or if the user has not activated their account yet if (empty($user->ID)) { return; } // First pass wp_user_avatars_section_content($user); }
/** * Output avatar field on edit/profile screens * * @since 0.1.0 * * @param object $user User object */ function wp_user_avatars_edit_user_profile($user = 0) { // Bail if current user cannot edit this user's avatar and rating if (!current_user_can('edit_avatar', $user->ID) && !current_user_can('edit_avatar_rating', $user->ID)) { return; } ?> <div id="wp-user-avatars-user-settings"> <h3><?php esc_html_e('Avatar', 'wp-user-avatars'); ?> </h3> <?php wp_user_avatars_section_content($user); ?> </div> <?php }