janboddez / share-on-mastodon

Easily share WordPress posts on Mastodon.
https://jan.boddez.net/wordpress/share-on-mastodon
GNU General Public License v3.0
39 stars 5 forks source link

The Post is shared on Mastodon only if manually edited #20

Closed mmontuori closed 3 years ago

mmontuori commented 3 years ago

The Post is shared on Mastodon only if manually edited. If a Post is created with API without the editor, the Post is not shared. You have to go manually and Update the article to be shared.

janboddez commented 3 years ago

Correct. You can force sharing, however, by adding the following to, e.g., your theme's functions.php.

// Always share supported Post Types.
add_filter( 'share_on_mastodon_enabled', '__return_true' );

This filter supports additional parameters, too (like, if you wanted to share only certain categories, etc.): https://jan.boddez.net/wordpress/share-on-mastodon#share_on_mastodon_enabled.

mmontuori commented 3 years ago

Excellent! Worked perfectly. Thanks for posting the code snippet. Closing issue...