I quickly hacked together this JavaScript Bookmarklet today, so it is without any checks and assumes you have enabled one Mastodon account for publishing, that you are hosting your blog on WordPress.com, and using the Classic Editor:
javascript:(function(){ publicizeFormEditHref = document.getElementById('publicize-form-edit'); publicizeFormEditHref.click(); mastodonCheckboxes = document.getElementsByClassName('wpas-submit-mastodon'); mastodonCheckboxes[0].checked = true; publicizeFormHideHref = document.getElementById('publicize-form-hide'); publicizeFormHideHref.click(); updateButtonHref = document.getElementById('publish'); updateButtonHref.click(); })();
The above code is the state of [Wayback/Archive] JavaScript Bookmarklet for the WordPress classic editor which enables mastodon publishing (assuming you have one mastodon publishing account enabled … ) and due to be improved in a later blog post.
This will enable the currently edited post to be published to Mastodon, then update/publish the post.
On enabling one Mastodon account for publishing: