WordPress.org

Support

Support » Plugins and Hacks » [Resolved] JetPack Sharing incompatibility

[Resolved] JetPack Sharing incompatibility

  • mpmchugh
    Participant

    @mpmchugh

    Custom Post Widgets’ Content Blocks are displaying odd behavior in regards to it’s interaction with the WordPress JetPack plugin’s sharing buttons.

    When embedded in a page, they don’t show their own Sharing buttons, but it prevents the page’s Sharing buttons from showing.

    When as widget in a sidebar, the Sharing buttons show up at the end of the page content, as expected, but there’s also a set that show up at the bottom of the widget itself.

    I’ve managed to hide the ones in the widget just using CSS, but it’s an odd incompatibility that should be corrected, especially where it’s preventing the sharing buttons from showing on pages where they are embedded.

    I think there’s a way of having a post type properly register itself, so that JetPack sees is, and would let you globally exclude it from the Sharing Settings panel:

    Sharing Settings Screenshot

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

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

    @vanderwijk

    How strange that JetPack does not allow you to exclude the ‘Content Block’ post type from the sharing settings panel, I have configured it as a normal custom post type.

    You can check the ‘Do not apply content filters’ checkbox on the widgets to prevent the buttons to be added to the widget areas.

    mpmchugh
    Participant

    @mpmchugh

    It is odd. Didn’t realize the ‘Do not apply content filters’ checkbox on the widgets was a work-around. Thanks for that, but it does then force you to need to do more formatting of the content. It’d be nice if at some point JetPack would allow them to be excluded.

    Another, probably related oddity is that on each Content Block’s editing page, the typical “Sharing” panel that allows you to dibble the sharing buttons is also missing.

    Sharing Panel Screenshot

    So it seems that something is certainly amiss with JetPack recognizing what the Content Blocks are.

    Thanks,
    Michale

    Plugin Author Johan van der Wijk
    Member

    @vanderwijk

    Hi Michale,

    I have found out why the content_block post type is not recognised by Jetpack.

    This week I will release version 2.5.3 of the plugin which allows you to make the post type public using a filter, and then it will work.

    Just add the following code to your functions.php file in the theme directory:

    function filter_content_block_init() {
    	$content_block_public = true;
    	return $content_block_public;
    }
    add_filter('content_block_post_type','filter_content_block_init');

    and then it should look like this screenshot: http://imgur.com/gi2sh0B

    mpmchugh
    Participant

    @mpmchugh

    That’s great. Is the function provided just needed before the update? Or will it still be needed after the 2.5.3 update?

    Thanks,
    Michael

    Plugin Author Johan van der Wijk
    Member

    @vanderwijk

    Sorry for the confusion, the provided function will be needed after the update to 2.5.3.

    As soon as I get positive feedback from this topic I will release the new version which includes the fix for your issue: http://wordpress.org/support/topic/make-post-type-public?replies=4

    mpmchugh
    Participant

    @mpmchugh

    I’m curious, though. Can’t that function just be included as part of the plugin?

    It seems odd to need to require a manual function entry to handle it.

    Plugin Author Johan van der Wijk
    Member

    @vanderwijk

    In the content_block post type the option public has been set to false to prevent it from showing up in the internal search results or to be accessible outside the context of the post/page or widget area it has been added to.

    Therefore it is not possible to change the public setting by default. In very specific cases it might be necessary to be able to override this setting and that is why I created this filter.

    In your case the issue is that Jetpack is not clever enough to only include the sharing buttons in post types that you specify. That is the reason why you need to change the public option in your functions.php 🙂

    mpmchugh
    Participant

    @mpmchugh

    Okay. Perhaps you can add the function to the FAQ page for future reference.

    By the way, as you might have noticed in the screenshot I linked above, there are other plugins and theme generate Post Types that do properly show up in Jetpacks settings, so perhaps there’s something you can communicate to them about supporting recognizing CPW in a future release. Just a thought.

    Thanks,
    Michael

    Plugin Author Johan van der Wijk
    Member

    @vanderwijk

    Yes, as soon as the new version has been released I shall add some info about this new function to the FAQ.

    The problem with Jetpack is that it adds the buttons to all post types by default. Even when it doesn’t recognize a custom post type, it still adds the buttons. It should be the other way around, so by default not show the buttons, unless the post type has been selected in the options panel of the plugin. Please feel free to point the Jetpack team to this support ticket.

    mpmchugh
    Participant

    @mpmchugh

    I posted a ticket in the Jetpack support forum referencing this one.

    Thanks,
    Michael

    Richard Archambault
    Happiness Engineer

    @richardmtl

    The problem with Jetpack is that it adds the buttons to all post types by default. Even when it doesn’t recognize a custom post type, it still adds the buttons. It should be the other way around, so by default not show the buttons, unless the post type has been selected in the options panel of the plugin.

    I just did some tests to try to confirm this: I created a new Custom Post Type, and checked the Sharing Settings page. It was not checked by default, so the buttons didn’t show on the Published CPT. I then created a new post in that CPT; the sharing button on the CPT edit page WAS checked by default, but the unchecked value on the Settings -> Sharing page over-rides that checked status for the post.

    So, tl;dr is that no, Jetpack does not add buttons to all post types by default. 🙂 If you think I’m mistaken, though, I am all ears!

    mpmchugh
    Participant

    @mpmchugh

    As I noted above (see screenshot link in 1st post here) with Custom Post Widget, a checkbox for it’s Custom Post Type doesn’t even show up on the Sharing Settings page.

    Is there something odd about how Custom Post Widget creates/registers its custom post type?

    Plugin Author Johan van der Wijk
    Member

    @vanderwijk

    Hi mpmchugh, have you tried the fix that I mentioned earlier in this thread?

    mpmchugh
    Participant

    @mpmchugh

    Hi Johan,

    Sorry for the delayed response. I tried the filer you suggested on a new project, and though it does indeed now show up as a checkbox on the JetPack site, the problem is the share buttons still show on the blocks, even with it unchecked.

    -Michael

    mpmchugh
    Participant

    @mpmchugh

    I also noticed that though there’s now a “Show Sharing Buttons” metabox and checkbox on the individual Content Blocks edit screens. It also seems to have no effect.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Resolved] JetPack Sharing incompatibility’ is closed to new replies.