with_front won’t add ‘false’ to cpt definition
-
Hi,
I recently added /blog/ as part of my permastructure (intending it for blog posts only) and discovered that even though I had set “with_front” to False in all my custom post types, they were still getting /blog/ added to the URL. I dug through the code and discovered that if with_front is set to false, it doesn’t add anything to the cpt arguments, which doesn’t work because the default is true.It appears to be due to line 259 (version 1.1.1):
if ( $cptm_withfront ) { $cptm_rewrite_options[‘with_front’] = $cptm_withfront; }So if $sptm_withfront is False, it doesn’t set anything for $cptm_rewrite_options[‘with_front’]
I just eliminated the if statement and changed that line to:
$cptm_rewrite_options[‘with_front’] = $cptm_withfront;and now I have https://www.example.com/blog/my-blog-post for blog posts and https://www.example.com/customslug/custom-post for everything else.
It’s very possible that I just missed or misunderstood something, so if there’s something I should be doing differently, can you let me know? If not, perhaps you’d want to change this line for the next release?
Thanks,
Carina
- The topic ‘with_front won’t add ‘false’ to cpt definition’ is closed to new replies.