• Resolved nat47

    (@nat47)


    Is it possible to use this plugin to map to a custom post type that is

    	'public'    => false,
    	'show_ui'   => true,

    It isn’t showing up as a drop-down option under Existing Post (Post Type) and I’ve tried adding filters. I can’t seem to get the filters to work on a regular post, but here’s what I was trying for my custom post type named resources.

    add_action( 'cf7_2_post_save-resources', 'cf7_to_resources',10,3);
    function cf7_to_resources($cf7_key, $submitted_data, $submitted_files){
      if('my-resource-form' != $cf7_key){
        return;
      }
    else{
      $title =  $submitted_data['your-name'];
      $content = $submitted_data['your-message'];
    
      $post_args = array(
        'post_type' => 'resources',
        'post_status' => 'draft',
        'post_title' => $title,
        'post_content' => $content,
      );
    
      $post_id = wp_insert_post($post_args);
      update_post_meta($post_id, 'your_email', $email);
    }
    }
    
    • This topic was modified 7 years, 10 months ago by nat47.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Map to Non-Public Custom Post Type’ is closed to new replies.