How do you produce a new usermeta area having a drop lower selection values?

Im are thinking about creating a conditional statement for those customers having a certain worth of the brand new custom area I would like.

For instance,

The brand new area could be: Approved The drop lower values are: It depends

The conditional statement will recognize all customers using the Approved area worth of Yes. It will publish a code.

Im dealing with the wordpress_get_current_user function(), which does precisely what I want, however i only need a brand new custom usermeta area. Within the example the brand new usermeta area could be "artwork_approved."


if ($current_user->artwork_approved == 'Yes'){
    echo 'Thank you for approving your artwork!';

There appears to become no wordpress plugin with this and that i really need this feature. I'd really appreciate top tips on developing a new usermeta with drop lower options.


I made use of the Register Plus Redux to produce a new usermeta area, known as "Artwork Approved." I managed to get a drop lower option, with options "No" and "Yes." No choice is set as default.

This produced the "Artwork Approved" usermeta area. I manage user accounts and select either Good or bad. With this new usermeta area, Im utilizing a function which should see if the present user has got the Artwork Approved with worth of Yes. Then its supposed show a particular code.

This is actually the if statement Im using using the new usermeta area:

<?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 is happening is it isn't realizing part one from the if statement. Basically log into any account using the artwork approved, the if statement only shows the "else" part even when I have the choice "Yes" for Artwork Approved.

I'm not sure why it is not realizing the Yes Option when i get it within the statement.


You may create an easy wordpress plugin to hook in to the account actions and give a new area.

To include the area towards the form you are able to hook in to the show_user_profile and edit_user_profile actions and output the shape area HTML. The below utilizes a checkbox as opposed to a drop-lower.

add_action('show_user_profile', 'my_user_profile_edit_action');
add_action('edit_user_profile', 'my_user_profile_edit_action');
function my_user_profile_edit_action($user) {
  $checked = (isset($user->artwork_approved) && $user->artwork_approved) ? ' checked="checked"' : '';
  <label for="artwork_approved">
    <input name="artwork_approved" type="checkbox" id="artwork_approved" value="1"<?php echo $checked; ?>>
    Artwork approved

You will want to hook in to the personal_options_update and edit_user_profile_update actions, get the need for your area and save this as user meta.

add_action('personal_options_update', 'my_user_profile_update_action');
add_action('edit_user_profile_update', 'my_user_profile_update_action');
function my_user_profile_update_action($user_id) {
  update_user_meta($user_id, 'artwork_approved', isset($_POST['artwork_approved']));

Your problem would then be as below.

if (get_user_meta($current_user->ID, 'artwork_approved', true)) {