I am attempting to implement custom post types via the instructions on http://forum.gravityhelp.com/topic/add-a-form-to-create-a-new-custom-post-type. I would have posted this there but the topic is closed. As of Wordpress 3.01 the filter update_post_type() no longer appears to work.
This example code:
add_filter("gform_post_data", "update_post_type",10,2);
function set_post_type($post_data, $form){
echo"<pre>";print_r($post_data);echo"</pre>";
if($form["id"] == '1'){
$post_data["post_type"] = "investments";
}
return $post_data;
}
results in this error:
Fatal error: Cannot redeclare set_post_type() (previously declared in post.php:1062) in wp-content/themes/twentyten/functions.php on line 153
Any suggestions?
Thanks!