How to create a new usermeta field with dropdown selection values?
I want to create a conditional statement for all users with a specific value for the new custom field that I want.
For instance,
New field will be: Approved Drop-down values: Yes and No
The conditional statement recognizes all users with the Yes field value set. Then it will output the code.
Im working with the wp_get_current_user () function, which does exactly what I need, but I just need a new usermeta user field. In this example, the new usermeta field will be "artwork_approved".
Example:
wp_get_current_user(); if ($current_user->artwork_approved == 'Yes'){ echo 'Thank you for approving your artwork!'; }
There seems to be no plugin for this, and I really need this feature. I would really appreciate advice on creating a new utility with drop-down options.
* UPDATE:
I used Register Plus Redux to create a new usermeta field called Approved Jobs. I chose the option with the option "No" and "Yes." No is the default setting.
This created a "usermeta" field labeled "Artwork Approved". I manage user accounts and select "Yes" or "No". Now with this new โusermetaโ field, I am using a function that should check if the current user has an approved work with a value of โYesโ. Then it is supposed to show a specific code.
Here is the if statement using usermeta with the new field:
<?php global $current_user; get_currentuserinfo(); if ($current_user->artwork_approved == 'Yes') { ?> echo 'Your artwork is approved'; <?php } else { ?> echo 'Your artwork is not approved'; <?php } ?>
But what happens is not recognition of the first part of the if statement. If I log into any account with an approved cover, the if statement only shows โelse,โ even if I have the โYesโ option for the approved artwork.
I do not know why it does not recognize the Yes parameter as it is in the instruction.
thanks