• ianrogerslabshift

    (@ianrogerslabshift)


    The preview button for custom post types was broken in the metabox and elsewhere. This is the fix that worked for us:]

    
    --- a/wp-content/plugins/wp-permastructure/wp-permastructure.php
    +++ b/wp-content/plugins/wp-permastructure/wp-permastructure.php
    @@ -334,7 +334,7 @@ class wp_permastructure {
                            $permalink = home_url( str_replace($rewritecode, $rewritereplace, $permalink) );
                            $permalink = user_trailingslashit($permalink, 'single');
                    } else { // if they're not using the fancy permalink option
    -                       $permalink = home_url('?p=' . $post->ID);
    +                       $permalink = $post_link ? $post_link : home_url('?p=' . $post->ID);
                    }
     
                    return $permalink;
    
  • The topic ‘Preview button broken with custom post types (fix attached)’ is closed to new replies.