Cannot create new custom post types
-
Whenever I try to create a new custom post type, regardless of slug or name, i get two Messages. The first one says, my new custom post type “xyz” was successfully created, the other one “wrong custom post type specified”. However, no new type is created
I took a look at some stuff in the plugin code (following), and it seems that in the function “wpcf_admin_custom_types_form()” it is looking for the to-be-created-slug in the array of already existing post types. I checked it, and the new slug is definitely passed as GET-parameter, as if I’d want to edit it. This is really frustrating. I looked everywhere in the internet, but nobody seems to have this issue. I wanted to register in the Types forums as well, but registration seems to be disabled.if ( isset( $_GET['wpcf-post-type'] ) ) { $id = sanitize_text_field( $_GET['wpcf-post-type'] ); } elseif ( isset( $_POST['wpcf-post-type'] ) ) { $id = sanitize_text_field( $_POST['wpcf-post-type'] ); } if ( $id ) { $custom_types = get_option( 'wpcf-custom-types', array() ); if ( isset( $custom_types[$id] ) ) { $ct = $custom_types[$id]; $update = true; // Set rewrite if needed if ( isset( $_GET['wpcf-rewrite'] ) ) { flush_rewrite_rules(); } } else { wpcf_admin_message( __( 'Wrong custom post type specified', 'wpcf' ), 'error' ); return false; } } else { $ct = wpcf_custom_types_default(); }
The topic ‘Cannot create new custom post types’ is closed to new replies.