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

  • Home
  • SEARCH
  • 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 8741361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:17:57+00:00 2026-06-13T11:17:57+00:00

To keep it short: I built a meta box with 3 fields, but it’s

  • 0

To keep it short: I built a meta box with 3 fields, but it’s only saving the first field. What could I be doing wrong?

// --- METABOX: CAREER ... CONTENTS --- //
function career_meta(){
global $post;
$career1 = get_post_meta( $post->ID, 'career1', true );
$career2 = get_post_meta( $post->ID, 'career2', true );
$career3 = get_post_meta( $post->ID, 'career3', true );
?>
<label for="career_subtitle">Subtitle</label><input type="text" class="widefat" id="career-subtitle" name="career_subtitle" value="<?php echo $career1; ?>" />
<label for="career_text_1">Left Column</label><textarea class="widefat" id="career-text-1" name="career_text_1" value="<?php echo $career2; ?>"></textarea>
<label for="career_text_2">Right Column</label><textarea class="widefat" id="career-text-2" name="career_text_2" value="<?php echo $career3; ?>"></textarea>
<?php }

// --- METABOX: CAREER ... SAVE --- //
add_action('save_post', 'save_career');
function save_career(){
    global $post;
    update_post_meta($post->ID, "career1", $_POST["career_subtitle"]);
    update_post_meta($post->ID, "career2", $_POST["career_text_1"]);
    update_post_meta($post->ID, "career3", $_POST["career_text_2"]);
}
add_action('save_post','function_save_var');
function function_save_var()
{
  if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
    return $post_id;

}

That’s what I have right now. It saves the first field (career_subtitle) but not the 2 other ones. Fixing this is quite important so I would really appreciate an effective answer 🙂

  • 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-06-13T11:17:58+00:00Added an answer on June 13, 2026 at 11:17 am

    This maynot be the solution to your question but are you sure that textarea has a value attribute????

    This could solve your problem:-

    <label for="career_text_1">Left Column</label><textarea class="widefat" id="career-text-1" name="career_text_1"><?php echo $career2; ?></textarea>
    <label for="career_text_2">Right Column</label><textarea class="widefat" id="career-text-2" name="career_text_2"><?php echo $career3; ?></textarea>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To keep it short and sweet: There is hibernate-commons-annotations 4.1.0-Final and hibernate-annotations 3.5.6-Final. I'm
I've been searching for this for a while and keep coming up short. However
Short Version: I'm looking for a technique to keep nearly-sorted data in nearly-sorted order
I wanted to keep my logging statements as short as possible while preventing console
I understand we need to keep @Transactional boundaries as short as possible. Here is
I have a complicated question, so I will try and keep it as short
Short version: What's the best way to override dict.keys() and friends to keep myself
I'll try to keep the question simple and short - what are the best
I am using XDocument to keep a sort of database. This database consists of
Keep running into When using the multi-mapping APIs ensure you set the splitOn param

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.