• Resolved katmacau

    (@katmacau)


    Hello. I want to use Forminators create post form with a custom post type that does not include a single view.

    I have WP Store Locator on the site. I have ‘enabled permanlink’ disabled as we only want the store posts to show on the stores listing page. When adding a store its added as a custom post type with a heading, custom fields etc. If I enable ‘permalink’ view then I can see WP Stores appear in the forminator list of post types to choose from. But if i disable permalink view then it breaks the form and/or doesnt show WP Stores as an option.

    Is it possible to select custom post types which don’t have single post views with the create post form? I assume WP Stores is not the only case where this setup might be needed.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @katmacau

    I hope you are doing well today.

    get_post_types( array( 'public' => true ), 'objects' )

    ^ We fetch post types like the above, which means the post type should be publicly viewable/accessible. Setting?public?to false for that post type makes it not show in the Forminator post type list. That is possibly what the ‘enabled permalink’ feature does in that plugin.

    I’m afraid you will need to report this issue to WP Store Locator support.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @katmacau

    I spoke in the meantime with our SLS Team about your query. Please try this snippet as a mu-plugin:

    add_filter( 'forminator_postdata_post_type_list', 'wpmudev_show_store_locator_post', 10, 1 );
    function wpmudev_show_store_locator_post( $post_type_list ) {
        $post_type_list[] = array( 'value' => 'wpsl_stores', 'label' => 'Store Locator' );
        return $post_type_list;
    }

    You can follow our docs here for more detailed steps on how to install a?mu-plugin.
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Kind Regards,
    Kris

    Thread Starter katmacau

    (@katmacau)

    This is perfect! Thank you.

    I was able to use your create a post form and map the custom fields to create the new store post.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create post form – CPT with no single view not available’ is closed to new replies.