Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5967791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:59:42+00:00 2026-05-22T19:59:42+00:00

How do I create a new usermeta field with a drop down selection values?

  • 0

How do I create a new usermeta field with a drop down selection values?

Im want to create a conditional statement for all users with a certain value of the new custom field I want.

For example,

The new field would be: Approved
The drop down values are: Yes and No

The conditional statement will recognize all users with the Approved field value of Yes. Then it will post a code.

Im working with the wp_get_current_user function(), which does exactly what I need, but I just need a new custom usermeta field. In the example the new usermeta field would 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 some advice on creating a new usermeta with drop down options.

*UPDATE:

I used the Register Plus Redux to create a new usermeta field, called “Artwork Approved.” I made it a drop down option, with options “No” and “Yes.” The No option is set as default.

This created the “Artwork Approved” usermeta field. I manage user accounts and choose either Yes or No. Now with this new usermeta field, Im using a function that should check if the current user has the Artwork Approved with value of Yes. Then it is supposed show a certain code.

Here is the if statement Im using with the new usermeta 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’s happening is it’s not recognizing the first part of the if statement. If I log into any account with the artwork approved, the if statement only shows the “else” part even if I have the option “Yes” for Artwork Approved.

I don’t know why it isn’t recognizing the Yes Option as I have it in the statement.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:59:43+00:00Added an answer on May 22, 2026 at 7:59 pm

    You can create a simple plugin to hook into the user profile actions and add a new field.

    To add the field to the form you can hook into the show_user_profile and edit_user_profile actions and output the form field HTML. The below uses a checkbox rather than a drop-down.

    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"' : '';
    ?>
      <h3>Other</h3>
      <label for="artwork_approved">
        <input name="artwork_approved" type="checkbox" id="artwork_approved" value="1"<?php echo $checked; ?>>
        Artwork approved
      </label>
    <?php 
    }
    

    Then you need to hook into the personal_options_update and edit_user_profile_update actions, get the value of your field 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 condition would then be as below.

    if (get_user_meta($current_user->ID, 'artwork_approved', true)) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to create new membership users in an Ektron CMS400.NET-based website by
I'm using Visual Basic 9 (VS2008) I want to create new Tabs as and
I create new desktop with CreateDesktop and want to get it's DC & RC.
I want to create new class MapActivity from Eclipse. I go File-> New ->
I prefer not to create new files. I want to accomplish something similar to:
I want to create new work document from sketch with Python on Linux platform,
I want to create a new screen, when I click on Report Button .
I create new asp.net mvc 3 project. Copy there all controllers, classes and views
I´m trying to create new elements in my database. I can fill all the
I create new ASP.NET web application that use SMTP to send message. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.