• Hello,

    I’m successfully using your plugin until I need to preview draft or pending custom post : it always gives me a 404 page.

    Looking at your code, I saw line 339 :
    $permalink = home_url('?p=' . $post->ID);

    which is the default permalink given when post status is draft/pending or auto-draft.

    The defaut permalink for a custom post type should add post_type=custom_post_type in URL.

    So here is the fixed code (line 339) :
    $permalink = home_url('?post_type=' . $post_type->name . '&p=' . $post->ID);

    https://www.ads-software.com/plugins/wp-permastructure/

  • The topic ‘Default permalink for draft/pending Custom Post Type’ is closed to new replies.