0

In the Author Metaboxes for Posts / pages / custom types, it shows: Name (Username)

Is there anyway to customize this to just show Name only? Or maybe Name and Role?

I am pretty sure if it done with wp_dropdown_users but I'm not sure how to use it to make it do what I want and add it as function.

Thank you.

Edit: Screenshot for clarification. This is from the backend of the post editor. My username is Test and my name is John Smith in this example.

enter image description here

3
  • Could you please add a screenshot in relation to the Author metabox you are referring to? Is it the back-end Author (select) box or the Author in the front-end?
    – Anake.me
    May 3, 2021 at 6:45
  • Interesting question. There is an attribute to choose what field to display in option and default value is set to display just a name. So, wordpress developers call this function with attribute to show "name (nickname)". There are 2 filters used, one for filtering parsed arguments and query vars, second one for filtering html output. Tried first filter, but it leads to an error if I just unset username from a fields argument. Second filter sounds dirty and requires to just find positions of "()" and cut them from a string. Maybe someone smarter can solve this more natively.
    – anton
    May 3, 2021 at 9:33
  • Added a screenshot as per requested to help clarify
    – Tamerax
    May 3, 2021 at 12:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.