The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Add custom fields in post form (1 post)

  1. Puanthanh Gangmei
    Posted 5 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 5 years ago by Puanthanh Gangmei
  • This topic is not resolved
  • WordPress version: 3.0.4