• I am working on a website that I use Flamingo on.

    I am not sure how to explain this easily nor am I able to reproduce the problem on another site but one of the items in the Flamingo table was actually showing on the front end – that is to say the content of the form (person’s name, email and other fields in the form) that a user had filled in and sent was being displayed using the single.php template without being asked!

    My single.php file is not much different than the one found in twentyseventeen or other out-of-the-box themes.

    I believe that the way Flamingo works is that it creates a post type called flamingo_inbound amongst other post types. It seems that one individual flamingo_inbound post had some kind of collision with a particular page of a custom post type I have and was “redirected” to the single.php page to display the content of the email/form.

    This was only happening for one item – and the only thing I could think of was that it was some kind of name collision.

    The page in question has the same name (permalink) as the Contact Form 7 form name that was used in the item/post that was being “accidentally” displayed.

    I “fixed” the issue by making single.php check what type of post it is trying to display. However that is still not an ideal solution and I am not sure if that it won’t happen again using some other template.

    Just to be sure I also changed the name and permalink of the page that was being pushed to the single.php instead of the template it was meant to use and 301 redirected the original page/url.

    The collision, if there is one, seems to be related to how I am cleaning up CPT urls with the following – but it has never been a problem before with or without Flamingo:

    function alpha_remove_cpt_slug( $post_link, $post, $leavename ) {
     
        if ( ! in_array( $post->post_type, array( 'advanced_page' ) ) || 'publish' != $post->post_status )
            return $post_link;
     
        $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
     
        return $post_link;
    }
    add_filter( 'post_type_link', 'alpha_remove_cpt_slug', 10, 3 );

    It may be that the above function is not related to the problem but when I turn it off the issue seems to go away – I believe it is a fairly well known and used method for making urls of cpts prettier.

    I hope I have explained the issue enough for someone to maybe have an explanation.

    Any help is obviously much appreciated.

    • This topic was modified 6 years, 10 months ago by danMWD.
    • This topic was modified 6 years, 10 months ago by danMWD.
  • The topic ‘Flamingo Inbound Displaying on Front End in Error’ is closed to new replies.