WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Widget
JetPack Sharing incompatibility (18 posts)

  1. mpmchugh
    Member
    Posted 5 months ago #

    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/

  2. Johan van der Wijk
    Member
    Plugin Author

    Posted 5 months ago #

    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.

  3. mpmchugh
    Member
    Posted 5 months ago #

    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

  4. Johan van der Wijk
    Member
    Plugin Author

    Posted 4 months ago #

    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

  5. mpmchugh
    Member
    Posted 4 months ago #

    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

  6. Johan van der Wijk
    Member
    Plugin Author

    Posted 4 months ago #

    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

  7. mpmchugh
    Member
    Posted 3 months ago #

    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.

  8. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 months ago #

    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 :)

  9. mpmchugh
    Member
    Posted 3 months ago #

    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

  10. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 months ago #

    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.

  11. mpmchugh
    Member
    Posted 3 months ago #

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

    Thanks,
    Michael

  12. 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!

  13. mpmchugh
    Member
    Posted 3 months ago #

    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?

  14. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 months ago #

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

  15. mpmchugh
    Member
    Posted 1 month ago #

    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

  16. mpmchugh
    Member
    Posted 1 month ago #

    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.

  17. sk
    Member
    Posted 1 month ago #

    Also having this problem, here's what I've tried from your suggestions Johan:
    - Tried the filter within functions.php and it works to show the checkbox in Jetpack settings, but it doesn't do anything to remove the Jetpack sharing
    - Tried to uncheck the box "Show sharing buttons" on the content block and this had no effect. The setting wouldn't even save.
    - Within widgets, setting the option "Do not apply content filters" works nicely. Can this be applied to the shortcodes? I'm use more shortcodes than widgets to display content blocks.

    Happy to test other things, very keen to get this resolved :)

  18. sk
    Member
    Posted 3 weeks ago #

    Well, this is not resolved, so can this be marked accordingly?

Reply

You must log in to post.

About this Plugin

About this Topic