PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Can't get some $post_data

  1. Update: I have tried overwriting post_content like so

    $post_data["post_content"] = '';

    and yet the form still returns the post content. I can only think that either gravity forms doesn't use $post_data["post_content"] for it's post boy field, which seems unlikely, or the $post_data["post_content"] is not given a value until after this hook has fired. I am using "Create content template" with my post body field, could this effect it?

    I am using the following code (full source in the following pastebin) to check if a form submission has certain checkboxes ticked, and if so go through a few conditionals to add some extra custom taxonomy terms and in 1 instance create a copy of the submitted post.

    This is basically working fine, The issue is that the copied post doesn't have all the information. There is no post content and the custom terms are missing. I am wondering if their is anything I am missing here specific to gravity forms.

    Here is how I am creating the copy of the post

    $postCopy = array(
    			  'comment_status' => $post_data['comment_status'], // 'closed' means no comments.
    			  'post_author'    => $post_data['post_author'], //The user ID number of the author.
    			  'post_content'   => $post_data['post_content'], //The full text of the post.
    			  'post_date_gmt'  => $post_data['post_date_gmt'], //The time post was made, in GMT.
    			  'post_name'      => $post_data['post_name'], // The name (slug) for your post
    			  'post_status'    => $post_data['post_status'], //Set the status of the new post.
    			  'post_title'     => $post_data['post_title'], //The title of your post.
    			  'post_type'      => 'apprentice', //You may want to insert a regular post, page, link, a menu item or some custom post type
    			  'tax_input'      => $post_data['tax_input']
    			); 
    
    			$postCopy["tax_input"]['college'][] = 'sussex-downs'; 
    
    			wp_insert_post( $postCopy, $wp_error );

    It seems I have an issue with both 'post_content' => $post_data['post_content'] and 'tax_input' => $post_data['tax_input']

    Full Source : http://pastebin.com/gsw7yAmm

    Thanks

    Posted 6 years ago on Thursday May 16, 2013 | Permalink
  2. Handling via priority support.

    Posted 6 years ago on Friday May 17, 2013 | Permalink

This topic has been resolved and has been closed to new replies.