[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

Content in Custom Post type field keeps disappearing

Let me preface with I SUCK at php coding. But I know what I want and I try to make it work.
I've managed to create custom fields for vimeo and youtube videos by using some code I found on line. Now I've spent over 2 hours trying to add more fields within this video box.I'm dyin' over here please look at my code and tell me what I'm doing wrong.
I need the additional image and caption fields. I've got them showing up, but any input immediately disappears upon saving and I don't get anything when I use
get_post_meta($post->ID, 'image01', true);

Open in new window

in the template. Looks like the video code is using a variable instead.

Here's my code:

/************* For Videos and other Media Behind the Scenes! **********/

// Create the Video Information Meta Box by hooking into the admin menu for a post
add_action('admin_menu', 'video_add_box');

//Function call by the "add_action" to tell it what to add, "video_information" and where "post"
function video_add_box(){
add_meta_box('video_information', 'Behind the Scenes', 'video_information', 'writer', 'normal', 'high');
}

//function to populate the meta box added above
function video_information(){
global $post;
  
// Noncename needed to verify where the data originated
echo '<input type="hidden" name="video_noncename" id="video_noncename" value="' .
wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

//adds the custom field _youtubeID plus some other stuff
$youtubeID = get_post_meta($post->ID, '_youtubeID', true);
if ( empty($youtubeID) ) {
$youtubeID = '';
}

//adds the custom field _vimeoID
$vimeoID = get_post_meta($post->ID, '_vimeoID', true);
if ( empty($vimeoID) ) {
$vimeoID = '';


$custom = get_post_custom($post->ID);
$image01 = $custom["image01"][0];
$caption01 = $custom["caption01"][0];
$image02 = $custom["image02"][0];
$caption02 = $custom["caption02"][0];
$image03 = $custom["image03"][0];
$caption03 = $custom["caption03"][0];
$image04 = $custom["image04"][0];
$caption04 = $custom["caption04"][0];
   
}
//add the box
?><h2>Please only choose one: Slideshow, Text or Video</h2>
	<p style="font-weight: bold; font-size: 1.2em">Image Sizes must be exactly 577 x 352.</p>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 1:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image01; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption01"><?php echo $caption01; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 2:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image02; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 2</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption02"><?php echo $caption02; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 3:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image03; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 3</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption03"><?php echo $caption03; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 1:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20"  <?php echo $image04; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption04"><?php echo $caption04; ?></textarea>
  </div>
  <?php
echo '<br />';
echo 'Input <strong>Youtube ID:</strong>  <input type="text" name="_youtubeID" value="' . $youtubeID  . '" size="20" maxlength="30" /> or ';
echo '<strong>Vimeo ID:</strong>  <input type="text" name="_vimeoID" value="' . $vimeoID  . '" size="20" maxlength="30" />';
echo '<br />';
} //end video_information function

//save_video_meta is called below with the action "save_post" and saves your IDs to the post
function save_video_meta($post_id, $post) {
// verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times

if ( !wp_verify_nonce( $_POST['video_noncename'], plugin_basename(__FILE__) )) {
return $post->ID;
}

// Is the user allowed to edit the post or page?

if ( !current_user_can( 'edit_post', $post->ID )){
return $post->ID;
}

$video_meta['_youtubeID'] = $_POST['_youtubeID'];
$video_meta['_vimeoID'] = $_POST['_vimeoID'];
foreach ($video_meta as $key => $value) { // Cycle through the $video_meta array
if( $post->post_type == 'revision' ) return; // Don't store custom data twice

$value = implode(',', (array)$value); // If $value is an array, make it a CSV

if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value
update_post_meta($post->ID, $key, $value);
update_post_meta($post->ID, "image01", $_POST["image01"]);
update_post_meta($post->ID, "caption01", $_POST["caption01"]);
update_post_meta($post->ID, "image02", $_POST["image02"]);
update_post_meta($post->ID, "caption02", $_POST["caption02"]);
update_post_meta($post->ID, "image03", $_POST["image03"]);
update_post_meta($post->ID, "caption03", $_POST["caption03"]);
update_post_meta($post->ID, "image04", $_POST["image04"]);
update_post_meta($post->ID, "caption04", $_POST["caption04"]);
  
} else { // If the custom field doesn't have a value
add_post_meta($post->ID, $key, $value);
}
if(!$value) delete_post_meta($post->ID, $key); // Delete if blank
}//endforeach video meta

  
} //end save_video_meta


//save the video custom fields
add_action('save_post', 'save_video_meta', 1, 2);

Open in new window


Any help would be appreciated. Thanks!
0
Alicia St Rose
Asked:
Alicia St Rose
  • 4
1 Solution
 
jrm213jrm213Commented:
Hi,

I think you need to change the code as attached in the code block below.


Basically the foreach loop was only running through for each key in $video_meta. If the key already has a value it updates it, otherwise it adds it.

Your code was only updating the data but was not adding it if it didn't exist yet.

/************* For Videos and other Media Behind the Scenes! **********/

// Create the Video Information Meta Box by hooking into the admin menu for a post
add_action('admin_menu', 'video_add_box');

//Function call by the "add_action" to tell it what to add, "video_information" and where "post"
function video_add_box(){
add_meta_box('video_information', 'Behind the Scenes', 'video_information', 'writer', 'normal', 'high');
}

//function to populate the meta box added above
function video_information(){
global $post;
  
// Noncename needed to verify where the data originated
echo '<input type="hidden" name="video_noncename" id="video_noncename" value="' .
wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

//adds the custom field _youtubeID plus some other stuff
$youtubeID = get_post_meta($post->ID, '_youtubeID', true);
if ( empty($youtubeID) ) {
$youtubeID = '';
}

//adds the custom field _vimeoID
$vimeoID = get_post_meta($post->ID, '_vimeoID', true);
if ( empty($vimeoID) ) {
$vimeoID = '';


$custom = get_post_custom($post->ID);
$image01 = $custom["image01"][0];
$caption01 = $custom["caption01"][0];
$image02 = $custom["image02"][0];
$caption02 = $custom["caption02"][0];
$image03 = $custom["image03"][0];
$caption03 = $custom["caption03"][0];
$image04 = $custom["image04"][0];
$caption04 = $custom["caption04"][0];
   
}
//add the box
?><h2>Please only choose one: Slideshow, Text or Video</h2>
	<p style="font-weight: bold; font-size: 1.2em">Image Sizes must be exactly 577 x 352.</p>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 1:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image01; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption01"><?php echo $caption01; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 2:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image02; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 2</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption02"><?php echo $caption02; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 3:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" <?php echo $image03; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 3</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption03"><?php echo $caption03; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 1:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20"  <?php echo $image04; ?> />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption04"><?php echo $caption04; ?></textarea>
  </div>
  <?php
echo '<br />';
echo 'Input <strong>Youtube ID:</strong>  <input type="text" name="_youtubeID" value="' . $youtubeID  . '" size="20" maxlength="30" /> or ';
echo '<strong>Vimeo ID:</strong>  <input type="text" name="_vimeoID" value="' . $vimeoID  . '" size="20" maxlength="30" />';
echo '<br />';
} //end video_information function

//save_video_meta is called below with the action "save_post" and saves your IDs to the post
function save_video_meta($post_id, $post) {
// verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times

if ( !wp_verify_nonce( $_POST['video_noncename'], plugin_basename(__FILE__) )) {
return $post->ID;
}

// Is the user allowed to edit the post or page?

if ( !current_user_can( 'edit_post', $post->ID )){
return $post->ID;
}

$video_meta['_youtubeID'] = $_POST['_youtubeID'];
$video_meta['_vimeoID'] = $_POST['_vimeoID'];
$video_meta['image01'] = $_POST['image01'];
$video_meta['caption01'] = $_POST['caption01'];
$video_meta['image02'] = $_POST['image02'];
$video_meta['caption02'] = $_POST['caption02'];
$video_meta['image03'] = $_POST['image03'];
$video_meta['caption03'] = $_POST['caption03'];
$video_meta['image04'] = $_POST['image04'];
$video_meta['caption04'] = $_POST['caption04'];
foreach ($video_meta as $key => $value) { // Cycle through the $video_meta array
if( $post->post_type == 'revision' ) return; // Don't store custom data twice

$value = implode(',', (array)$value); // If $value is an array, make it a CSV

if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value
update_post_meta($post->ID, $key, $value);
} else { // If the custom field doesn't have a value
add_post_meta($post->ID, $key, $value);
}
if(!$value) delete_post_meta($post->ID, $key); // Delete if blank
}//endforeach video meta

  
} //end save_video_meta


//save the video custom fields
add_action('save_post', 'save_video_meta', 1, 2);

Open in new window

0
 
Alicia St RoseOwner & Principle Developer/DesignerAuthor Commented:
Hi I tried the above code and it didn't work.
I'll tell you why:
Big duh factor, that's why. Notice in the html I have image01 for all of the
name=""

Open in new window

.
Also notice there is no
value=""

Open in new window

for the inputs?

I believe that was my original issue.

yes, hours figuring this out.
You live and learn.

I'm going to try your code with the proper HTML and
name=""

Open in new window

0
 
Alicia St RoseOwner & Principle Developer/DesignerAuthor Commented:
Hi,
Tried the code and now I'm getting this in the custom fields:

For images:

<br /><b>Notice</b>:  Undefined variable: image01 in <b>/Users/alicia/Sites/GirlScouts/wp-content/themes/GSstudio/functions.php</b> on line <b>463</b><br />

Open in new window


for captions:

<br />
<b>Notice</b>:  Undefined variable: caption01 in <b>/Users/alicia/Sites/GirlScouts/wp-content/themes/GSstudio/functions.php</b> on line <b>465</b><br />

Open in new window


Also on new author edit page I'm getting a host of these for all of my fields:

Notice: Undefined index: video_noncename in /Users/alicia/Sites/Mysite/wp-content/themes/GSstudio/functions.php on line 497

Notice: Trying to get property of non-object in /Users/alicia/Sites/MySite/wp-content/themes/GSstudio/functions.php on line 398

Notice: Undefined index: question01 in /Users/alicia/Sites/Mysite/wp-content/themes/GSstudio/functions.php on line 398

Notice: Trying to get property of non-object in /Users/alicia/Sites/Mysite/wp-content/themes/GSstudio/functions.php on line 399

Open in new window


Aargh!! I wish I knew more about this stuff!
0
 
Alicia St RoseOwner & Principle Developer/DesignerAuthor Commented:
I decided to incorporate the video code into my own code instead of the other way around. And I got it working without errors:

/*************************************************************/
/*** CUSTOM WRITE PANELS FOR CUSTOM POST TYPES ***/



add_action('admin_init', 'GSS_meta_boxes');
 
function GSS_meta_boxes(){
	add_meta_box("slider_scenes_meta", "Behind the Scenes Slider", "slider_scenes", "writer", "normal", "high");
	add_meta_box("questions_answers_meta", "Questions & Answers", "questions_answers", "writer", "normal", "high");
	add_meta_box("bio_photo_meta", "Bio Photo", "bio_photo", "writer", "normal", "high");
  add_meta_box("quote_meta", "Author Quote", "quote", "writer", "normal", "high");
  add_meta_box("bio_meta", "Bio", "bio", "writer", "normal", "high");
  add_meta_box("synopsis_meta", "Synopsis", "synopsis", "work", "normal", "high");
  add_meta_box("book_cover_meta", "Book Cover", "book_cover", "work", "normal", "high");
  add_meta_box("feature_how_to_meta", "Featured Image Instructions", "feature_how_to", "work", "normal", "high");
}

function slider_scenes(){
	global $post;
	$custom = get_post_custom($post->ID);
	$image01 = $custom["image01"][0];
	$caption01 = $custom["caption01"][0];
	$image02 = $custom["image02"][0];
	$caption02 = $custom["caption02"][0];
	$image03 = $custom["image03"][0];
	$caption03 = $custom["caption03"][0];
	$image04 = $custom["image04"][0];
	$caption04 = $custom["caption04"][0];
	$vimeo = $custom["vimeo"][0];
	$youtube = $custom["youtube"][0];
   
//add the box
?><h2>Add Video for slider</h2>
	<p>If video link is http://vimeo.com/18406962, ID is 18406962. Enter that ID below.</p>
<input style="border: 1px solid #dfdfdf;" name="vimeo" value="<?php echo $vimeo; ?>" size="20" maxlength="30" />
	<p>If video link is http://www.youtube.com/watch?v=UWHeEI7aOvc, ID is UWHeEI7aOvc. Enter that ID below.</p>
<input style="border: 1px solid #dfdfdf;" name="youtube" value="<?php echo $youtube; ?>" size="20" maxlength="30" />
	<h2>Add images for slider</h2>
	<p style="font-weight: bold; font-size: 1.2em">Image Sizes must be exactly 577 x 352.</p>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 1:</label></p>
  <input type="text" style="width: 50%;" name="image01" size="20" value="<?php echo $image01; ?>" />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption01"><?php echo $caption01; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 2:</label></p>
  <input type="text" style="width: 50%;" name="image02" size="20" value="<?php echo $image02; ?>" />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 2</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption02"><?php echo $caption02; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 3:</label></p>
  <input type="text" style="width: 50%;" name="image03" size="20" value="<?php echo $image03; ?>" />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 3</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption03"><?php echo $caption03; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Image No. 4:</label></p>
  <input type="text" style="width: 50%;" name="image04" size="20"  value="<?php echo $image04; ?>" />
  <p style="padding-left: 2px; font-weight: bold;"><label>Caption No. 4</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="caption04"><?php echo $caption04; ?></textarea>
  </div>
  <?php
  }
function questions_answers() {
  global $post;
  $custom = get_post_custom($post->ID);
  $question01 = $custom["question01"][0];
  $answer01 = $custom["answer01"][0];
  $question02 = $custom["question02"][0];
  $answer02 = $custom["answer02"][0];
  $question03 = $custom["question03"][0];
  $answer03 = $custom["answer03"][0];
  $question04 = $custom["question04"][0];
  $answer04 = $custom["answer04"][0];
  ?>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Question No. 1:</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="question01"><?php echo $question01; ?></textarea>
  <p style="padding-left: 2px; font-weight: bold;"><label>Answer No. 1</label></p>
  <textarea style="width: 98%;" cols="40" rows="5" name="answer01"><?php echo $answer01; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Question No. 2</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="question02"><?php echo $question02; ?></textarea>
  <p style="padding-left: 2px; font-weight: bold;"><label>Answer No. 2</label></p>
  <textarea style="width: 98%;" cols="40" rows="5" name="answer02"><?php echo $answer02; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Question No. 3</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="question03"><?php echo $question03; ?></textarea>
  <p style="padding-left: 2px; font-weight: bold;"><label>Answer No. 3</label></p>
  <textarea style="width: 98%;" cols="40" rows="5" name="answer03"><?php echo $answer03; ?></textarea>
  </div>
  <div style="margin-bottom: 15px; padding: 5px 10px 10px; background: #d2e3eb;">
  <p style="padding-left: 2px; font-weight: bold;"><label>Question No. 4</label></p>
  <textarea style="width: 98%;" cols="40" rows="2" name="question04"><?php echo $question04; ?></textarea>
  <p style="padding-left: 2px; font-weight: bold;"><label>Answer No. 4</label></p>
  <textarea style="width: 98%;" cols="40" rows="5" name="answer04"><?php echo $answer04; ?></textarea>
  </div>
  <?php
}
 
function bio_photo(){
  global $post;
  $custom = get_post_custom($post->ID);
  $bio_photo = $custom["bio_photo"][0];
  ?>
  <p style="font-weight: bold; font-size: 1.2em">Image Sizes must be exactly 252 x 357. <br />Please enter the file path from your media library.</p>
  <input name="bio_photo" style="width: 50%;" type="text" value="<?php echo $bio_photo; ?>" />
  <?php
}

function quote(){
  global $post;
  $custom = get_post_custom($post->ID);
  $quote = $custom["quote"][0];
  ?>
  <textarea style="width: 98%;" cols="40" rows="5" name="quote"><?php echo $quote; ?></textarea>
  <?php
}
 
function bio() {
  global $post;
  $custom = get_post_custom($post->ID);
  $bio = $custom["bio"][0];
  ?>
  <textarea style="width: 98%;" cols="40" rows="10" name="bio"><?php echo $bio; ?></textarea>
  <?php
}

function feature_how_to() {
  global $post;
  $custom = get_post_custom($post->ID);
  $feature_how_to = $custom["feature_how_to"][0];
  ?>
  <p style="font-size: 1.2em;"><strong>Featured Image</strong> is the image for the Works Archive page. Must be <strong>135 x 165</strong>.<br />
  <strong>Slider Featured Image</strong> is for the Slider in "See Their Work" on the single Authors page. Must be <strong>75 x 113</strong>.</p>
  <?php
}

function synopsis() {
  global $post;
  $custom = get_post_custom($post->ID);
  $synopsis = $custom["synopsis"][0];
  ?>
  <textarea style="width: 98%;" cols="40" rows="10" name="synopsis"><?php echo $synopsis; ?></textarea>
  <?php
}

function book_cover(){
  global $post;
  $custom = get_post_custom($post->ID);
  $book_cover = $custom["book_cover"][0];
  ?>
  <p style="font-weight: bold; font-size: 1.2em">Image Sizes must be exactly 176 x 266. <br />Please enter the file path from your media library.</p>
  <input name="book_cover" style="width: 50%;" type="text" value="<?php echo $book_cover; ?>" />
  <?php
}

//make sure to save values with this post

add_action('save_post', 'save_details');

function save_details(){
  global $post;
 
  update_post_meta($post->ID, "vimeo", $_POST["vimeo"]);
  update_post_meta($post->ID, "youtube", $_POST["youtube"]);
  update_post_meta($post->ID, "image01", $_POST["image01"]);
  update_post_meta($post->ID, "caption01", $_POST["caption01"]);
  update_post_meta($post->ID, "image02", $_POST["image02"]);
  update_post_meta($post->ID, "caption02", $_POST["caption02"]);
  update_post_meta($post->ID, "image03", $_POST["image03"]);
  update_post_meta($post->ID, "caption03", $_POST["caption03"]);
  update_post_meta($post->ID, "image04", $_POST["image04"]);
  update_post_meta($post->ID, "caption04", $_POST["caption04"]); 
  update_post_meta($post->ID, "question01", $_POST["question01"]);
  update_post_meta($post->ID, "answer01", $_POST["answer01"]);
  update_post_meta($post->ID, "question02", $_POST["question02"]);
  update_post_meta($post->ID, "answer02", $_POST["answer02"]);
  update_post_meta($post->ID, "question03", $_POST["question03"]);
  update_post_meta($post->ID, "answer03", $_POST["answer03"]);
  update_post_meta($post->ID, "question04", $_POST["question04"]);
  update_post_meta($post->ID, "answer04", $_POST["answer04"]);
  update_post_meta($post->ID, "bio_photo", $_POST["bio_photo"]);
  update_post_meta($post->ID, "quote", $_POST["quote"]);
  update_post_meta($post->ID, "bio", $_POST["bio"]);
  update_post_meta($post->ID, "synopsis", $_POST["synopsis"]);
  update_post_meta($post->ID, "book_cover", $_POST["book_cover"]);
  update_post_meta($post->ID, "feature_how_to", $_POST["feature_how_to"]);
  
  
}

Open in new window

0
 
Alicia St RoseOwner & Principle Developer/DesignerAuthor Commented:
I worked it out on my own. Found a code snippet that worked with my pre-existing code.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now