Wrong Slug Returned when Form Submitted
-
I had a GF form creating CPT posts working great last year. But over the past year of plugin and WP updates, and now reactivating this form, I receive a 404 error when the form is submitted. The form does not confirm and the custom post is not created.
From my server error log:
[Fri Apr 25 06:44:41 2014] [error] [client 208.104.128.182] File does not exist: /var/www/vhosts/domain.com/httpdocs/form-slug, referer: http://www.domain.com/form-slug/The problem is, somewhere in the process, there’s a function pulling “httpdocs” but I’m not sure where.
I’ve deactivated all plugins (except GF 1.8.7 and GFCPT 3.0.1) and switched to a generic Genesis child theme (but added my CPT code), but the error remains.
Ordinary GF forms that do not map to my custom post type work fine.
I tried flushing rewrite rules, and resetting permalinks, but neither helped.This is a sub-directory multisite network with this form on site ID=1. There are no Capital letters in the cpt slug.
One other thing to note: If I change permalinks back to default, everything works again. But for permalinks = Post name, we get the 404.
I’m looking for advice about how to track down what’s now breaking this for me.
Thanks.
Here is how I’m registering the CPT.
add_action( 'init', 'rbc_register_post_types' ); function rbc_register_post_types() { global $blog_id; //register custom post types rbc_register_post_type( 'Person', 'People', 'people', 'people', false, array( 'title', 'editor', 'thumbnail', 'excerpt', 'author', 'custom-fields' ) ); } function rbc_register_post_type( $type, $types, $cpt_name, $slug, $search=false, $supports, $showui=true ){ $type2=strtolower( $type ); $types2=strtolower( $types ); $slug=str_replace( " ", "-", $types2 ); $labels = array( 'name' =>$types, 'singular_name' => $type, 'add_new' => 'Add New', 'add_new_item' => 'Add New ' .$type, 'edit_item' => 'Edit '.$type, 'new_item' => 'New '.$type, 'view_item' => 'View '.$type, 'search_items' => 'Search '.$types, 'not_found' => 'No '.$types2.' found', 'not_found_in_trash' => 'No '.$types2.' found in Trash', 'parent_item_colon' => '', 'menu_name' => $types ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => $showui, 'query_var' => true, 'rewrite' => array("slug" => $slug, "with_front" => false), 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => null, 'has_archive' => true, 'exclude_from_search' => $search, 'supports' => $supports ); register_post_type( $cpt_name, $args ); }https://ww.wp.xz.cn/plugins/gravity-forms-custom-post-types/
The topic ‘Wrong Slug Returned when Form Submitted’ is closed to new replies.