User Field using Select Advanced should display User Full Name and Username too

Support General User Field using Select Advanced should display User Full Name and Username too

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14843
    MauroMauro
    Participant

    Hello Anh!
    Please note there is a shortcoming in how the users are displayed in the basic "user" field in MetaBox.

    When the users are listed and 2 users have the same first name or display name selected, there is no way to tell them apart!

    I would recommend to list all users as: [First-Name] [Last-Name] ([username])

    As an alternative, you could allow to customise how the users are shown in this field through its definition. I could not find any way to do so in the docs, so if this is already feasible please let me know how 🙂

    Thanks!
    Mauro

    PS: my code is:

    array(
    'id' => $prefix . 'submitted_by',
    'type' => 'user',
    'name' => esc_html__( 'Submitted By', 'timtopham' ),
    'query_args' => array(
    'role__in' => array('author','administrator','mentor'),
    ),
    'field_type' => 'select_advanced',
    'desc' => esc_html__( 'Pick a User', 'timtopham' ),
    ),

    #14857
    Anh TranAnh Tran
    Keymaster

    Hi Mauro, please use this filter:

    https://docs.metabox.io/filters/#choice-fields-user-post-taxonomy-filters

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.