Comments (7)
Good idea.
Just FYI: if posting is successful, the post will get a _share_on_mastodon_url
(hidden) custom field (or post meta field) attached to it. (In it would be the Mastodon URL.)
I myself actually show all "hidden" custom fields on WP Admin's Edit Post screen, which allows me to actually see the resulting URL right underneath the post editor. If it's there, I know posting was successful. (If not, the status was probably too long, i.e., over 500 chars. Or Mastodon could be down, etc.)
But I agree that, ideally, users would be notified more clearly. (Also, if you now wanted to repost something, you'd have to delete the post meta and hit the "Update" button on the Edit Post screen. I guess it'd be nice if eventually you could just "unlink" a toot with the click of a single button.)
Somewhat related:
I also display links to toots on the frond end (like, in the post meta section, next to the post date or something).
That last bit requires something like displaying the outcome of get_post_meta( get_the_ID(), '_share_on_mastodon_url', true )
in one of your theme templates. (It's a bit more complicated than that, though. Might one day add a template function that you could just pop into your theme.)
from share-on-mastodon.
WP seems to have an API for displaying messages right at the very top of wp-admin/, under the admin tool-bar - i've seen several plugs use this
going way off topic here, but i don't actually use WprdPress - i use ClassicPress which is a fork of WP 4.9 without the 'block/Gutenberg' editor - many millions of people (more than 5) did not like having this... crap, IMO... shoved down their throats and so CP was born with the edict of centering development around community input (like WP used to do way back when)
CP is a growing project - they just formed an LLC yesterday i believe - and i'm wondering if you'd be willing to support it - 'support' could be as little as fixing stuff with the WP version of your plug that breaks on CP, or as great as developing plugs for CP, etc.
if you search the WP repo for 'classicpress' you'll find quite a few devs that support it
from share-on-mastodon.
Yeah, merely showing notifications should be fairly easy. Not sure if it's Gutenberg-compatible, tho. I'll have a look regardless.
I know about CP but haven't really tried it, ever. Anyway, I do use this plugin both with the Classic Editor and without, so I'd be surprised if it currently needs fixing. That said, if such a fix should ever be required and the effort is fairly minimal, I guess I'd be open to it.
from share-on-mastodon.
so I'd be surprised if it currently needs fixing
it don't far as i know - i'm using it with CP which is TinyMCE only and it seems to work fine
from share-on-mastodon.
Thinking of leveraging the meta box itself to indicate if sharing went okay:
Still doubting about the "Unlink" link. I could just use the checkbox to find out if previously shared toots should be forgotten. (What I won't do just yet is use Mastodon's API to actually delete the toot, although that too wouldn't be very hard.)
In fact, "unlinking" a toot yet leaving the checkbox enabled would mean a new copy is posted to Mastodon ... Maybe it does make sense, then, to also delete the original toot. Hmm. Like for typos and stuff. (Advanced users that would want to somehow unlink toots but leave their Mastodon statuses untouched could always just delete the relevant _share_on_mastodon_url
fields.) I'd have to rename "Unlink" to "Undo," then. As in "Undo sharing," AKA "delete toot and forget it was ever there."
Might also add a simple function users could paste into their theme templates, to output a "syndication link" (i.e., a link to the relevant Mastodon status, in this case).
from share-on-mastodon.
hey Jan - for the moment i switched to Mastodon Autopost since it offers more config options in the UI, but i would encourage you to go ahead and add the successful post notification - i like the way you did that in your last post - i'll let you close this as you see fit
from share-on-mastodon.
No worries. What can I say, I'm a big fan of filter hooks for this kind of things. :-) Let you check in your code and keep track of changes, and once you start modding your site's theme--by means of a child theme, hopefully--it becomes almost a no-brainer to add snippets like these. Plus, less ("spaghetti") code on my end. Will close when the feature's delivered.
from share-on-mastodon.
Related Issues (20)
- Smarter default excerpt length HOT 1
- is_int instead of ctype_digit HOT 1
- Uncaught (in promise) Error: The "Get URL" request failed. HOT 3
- Max. No. of Images resets to 4 HOT 3
- Increase wp_remote_post() and wp_remote_get() time-out
- Authorize "code" not recognized? HOT 1
- "Validation failed" when posting through JetPack with hook HOT 7
- Support replies HOT 2
- Support favorites HOT 1
- Support reblogs
- Fix share_on_mastodon_enabled filter
- Does share on mastodon work with scheduled posting? HOT 1
- Multiple account support HOT 4
- Store client details "centrally" HOT 1
- Toot args filter gets custom field too late HOT 4
- Error message: Uncaught Error: Call to undefined function Share_On_Mastodon\mime_content_type() HOT 2
- Block editor toggle gets auto-enabled even for old posts HOT 1
- Gutenberg lets posts through even when the toggle is disabled HOT 1
- Look into "update_{$meta_type}_metadata" HOT 1
- Scheduled posts are not automatically shared HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from share-on-mastodon.