Making WordPress.org


Ignore:
Timestamp:
04/26/2023 05:34:39 PM (15 months ago)
Author:
Otto42
Message:

Auto populate nickname for blank cases. Fixes #6956

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-user-tweaks.php

    r12105 r12562  
    3838add_filter( 'bbp_get_displayed_user_field', function( $value, $field, $filter ) {
    3939    if ( 'edit' === $filter ) {
     40
     41        // When editing a user, if the nickname is blank, fill it in with the nice name.
     42        if ( 'nickname' === $field && empty( $value ) ) {
     43            $value = bbp_get_displayed_user_field( 'user_nicename', 'edit' );
     44        }
     45
    4046        return $value;
    4147    }
Note: See TracChangeset for help on using the changeset viewer.