Filter: um_custom_meta_permalink_base_generate_user_slug

Filters the user profile slug when custom meta is set.

Parameters:
Name Type Description
$slug string

User profile slug.

$user_id int

User ID.

$metakey string

Meta key.

Since:
  • 2.7.0
Source:
Returns:

User profile slug.

Type
string
Example

Use base64encode value as user slug.

function my_custom_meta_permalink_base_generate_user_slug( $slug, $user_id, $metakey ) {
    // your code here
    $slug = base64encode( $user_id );
    update_user_meta( $user_id, $metakey, $slug );
    $slug = rawurlencode( $slug );
    return $slug;
}
add_filter( 'um_custom_meta_permalink_base_generate_user_slug', 'my_custom_meta_permalink_base_generate_user_slug', 10, 3 );