• Resolved Donna Fontenot

    (@cavalierlife)


    Hi. I just edited about 30 old posts to solve a text color problem, and all 30 ended up being shared to Mastadon in quick succession. I’m sure my followers felt spammed. It would be great to have an option to exclude updates; only sharing new posts is ideal.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jan Boddez

    (@janboddez)

    There is. This will not happen if you uncheck the “Share on Mastodon” checkbox before updating.

    Granted, the checkbox is ticked by default. It can, however, be disabled, so that you would have to check it explicitly (also for new posts) in order to enable crossposting; if you’re familiar with adding hook callbacks to modify WP’s behavior, there’s the https://jan.boddez.net/wordpress/share-on-mastodon#share_on_mastodon_optin filter.

    In the upcoming version, this will be a “proper” UI setting.

    If you wanted to always disable syndication for posts before a certain “cut-off date,” there’s https://jan.boddez.net/wordpress/share-on-mastodon#share_on_mastodon_enabled, which, together with a bit of PHP (a check against $post->post_date, namely) could be used to do just that. You’d have to determine this cut-off date yourself; the plugin does not keep track of when it was installed.

    Thread Starter Donna Fontenot

    (@cavalierlife)

    Ah, yes, on the post itself, is a checkbox. I was looking in settings. Not exactly what I meant, but now that I know how it works, I’ll just have to be careful.

    Plugin Author Jan Boddez

    (@janboddez)

    Hehe, yes. I mean, we could set you up with a code snippet that would disable sharing for all posts before, say, Feb 1, 2023. Such a thing is possible.

    The “easy way out,” however, is to just ensure the checkbox is disabled (either by doing so explicitly or by copy-and-pasting the following into a site-specific plugin or your (child) theme’s functions.php:

    add_filter( 'share_on_mastodon_optin', '__return_true' );

    In the next version of the plugin (later this week?), this (“unchecked by default”) will be a “regular” setting, no need for custom code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Needs option to only share new posts’ is closed to new replies.