Hi Frisco,
I think this might have to do with the fact that the Content Block custom post type is not public by default.
You can try adding the following code to your theme’s functions.php file:
function filter_content_block_init() {
$content_block_public = true;
return $content_block_public;
}
add_filter('content_block_post_type','filter_content_block_init');
More background on this here: http://ww.wp.xz.cn/support/topic/make-post-type-public?replies=6
Thread Starter
frisco
(@frisco)
@johan – Thanks for the follow up.
The code block does indeed work and solve the issue that drew my comment regarding Post Type Switcher.
I also discovered your comment here http://www.vanderwijk.com/wordpress/wordpress-custom-post-widget/ that your reason for making the content block not public by default was to “not cause any duplicate content or other SEO issues”.
Is that the best way to achieve that goal? Is there another combination of CPT registration parameters that would allow a content block to be public but wouldn’t create duplicate content issues, such as has_archive or publicly_queryable? (Just wondering…haven’t tried this.)
Also, while making the CPT of your plugin public fixes the issue with Post Type Switcher, it would be great if that plugin simply ignored non-public CPT’s, which would mean you couldn’t change them to other CPT’s using it but they wouldn’t break. The changelog of Post Type Switcher suggests that was the case as of version 0.2, but when your content blocks aren’t public, Post Type Switcher doesn’t ignore them.
I’m marking this as resolved because I think this is more of a Post Type Switcher issue.
Thanks again.