WordPress.org

Ready to get started?Download WordPress

Forums

Add custom fields in post form (1 post)

  1. Marc P Gangmei
    Member
    Posted 3 years ago #

    I have a working post form from frontend. I like to add extra custom field into my form. I have been working on with update_post_meta but can't pull in or get the new custom field data from my form.

    Can anyone please help me out?
    Part of my form processor:

    $tags = $_POST['tags'];
    			$newtags = explode(',',$_POST['newtags']);
    			foreach ($newtags as $tag) {
    				wp_insert_term(trim($tag), 'tag');
    				$tags[] = trim($tag);
    			}
    
    			$post_status = 'pending';
    			if ( $options['article_status'] == '1' ) $post_status = 'publish';
    
    			$new_post = array(
    				'post_title' => wp_filter_nohtml_kses($_POST['title']),
    				'post_content' => $_POST['post'],
    				'post_status' => $post_status,
    				'post_author' => $user_ID,
    				'post_type' => 'post',
    				'post_category' => $_POST['cats'],
    				'tags_input' => implode(',',$tags),
    			);

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by Marc P Gangmei
  • This topic is not resolved
  • WordPress version: 3.0.4