WordPress.org

Support

Support » Plugins and Hacks » Custom Post Widget » [Resolved] Incompatibility with Post Type Switcher plugin

[Resolved] Incompatibility with Post Type Switcher plugin

  • Hi there. First, very useful and well supported plugin. Keep up the good work.

    With Custom Post Widget and the Post Type Switcher plugin activated, editing a content block causes the post type to be switched to post rather than content block. The initial save of the content block works fine; it’s only on the 2nd update that the post type gets unintentionally switched. Deactivating Post Type Switcher causes Custom Post Widget to function normally (ie, you can edit and re-edit content blocks).

    I’ll flag the plugin author of Post Type Switcher to this post in case he’s aware of anything.

    http://wordpress.org/plugins/post-type-switcher/

    https://wordpress.org/plugins/custom-post-widget/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Johan van der Wijk

    @vanderwijk

    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://wordpress.org/support/topic/make-post-type-public?replies=6

    @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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Incompatibility with Post Type Switcher plugin’ is closed to new replies.
Skip to toolbar