Function for the display_name dropdown that does not show empty fields
-
I have used this function to show the display_name dropdown dynamically but I would need to show only the fields that are not empty and the ones that are blank that do not appear, how could I validate the form so that it shows only the fields that are filled and hide the empty in the dropdown?
function display_name_list_dropdown() { $displayname = array( um_user( 'nickname' ) => um_user( 'nickname' ), um_user( 'first_name' ) => um_user( 'first_name' ), um_user( 'last_name' ) => um_user( 'last_name' ), um_user( 'first_name' )." ".um_user( 'last_name' ) => um_user( 'first_name' )." ".um_user( 'last_name' ), um_user( 'last_name' )." ".um_user( 'first_name' ) => um_user( 'last_name' )." ".um_user( 'first_name' ), um_user( 'business' ) => um_user( 'business' ), um_user( 'first_name' )." | ".um_user( 'empresa' ) => um_user( 'first_name' )." | ".um_user( 'business' ), um_user( 'empresa' )." | ".um_user( 'first_name' ) => um_user( 'business' )." | ".um_user( 'first_name' ) ); return $displayname; }
I have shown function => function because if I put ‘name’ = function in the wordpress profile the ‘name’ value is collected and not the function itself.
If you see that it can be developed in another way so that it appears both in the wordpress profile and in the UM profile in the same way, it would help me a lot and also not showing the empty fields.
Greetings and thank you.
- The topic ‘Function for the display_name dropdown that does not show empty fields’ is closed to new replies.