WordPress.org

Making WordPress.org

Changeset 4947


Ignore:
Timestamp:
02/19/2017 09:39:41 PM (4 years ago)
Author:
ocean90
Message:

Login: Keep the nickname meta since it's a required user meta.

See #148.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r4542 r4947  
    132132remove_action( 'rest_api_init', 'create_initial_rest_routes', 99 );
    133133
    134 // Don't need all the wp-admin specific user metas on user create/update
    135 add_filter( 'insert_user_meta', '__return_empty_array', 1 );
     134/**
     135 * Don't need all the wp-admin specific user metas on user create/update.
     136 *
     137 * @param array $meta Default meta values and keys for the user.
     138 * @return array Filtered meta values and keys for the user.
     139 */
     140function wporg_login_limit_user_meta( $meta ) {
     141    $keep = [ 'nickname' ];
     142    return array_intersect_key( $meta, array_flip( $keep ) );
     143}
     144add_filter( 'insert_user_meta', 'wporg_login_limit_user_meta', 1 );
Note: See TracChangeset for help on using the changeset viewer.