Giter Club home page Giter Club logo

Comments (7)

janboddez avatar janboddez commented on August 16, 2024

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.

atomGit avatar atomGit commented on August 16, 2024

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.

janboddez avatar janboddez commented on August 16, 2024

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.

atomGit avatar atomGit commented on August 16, 2024

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.

janboddez avatar janboddez commented on August 16, 2024

Thinking of leveraging the meta box itself to indicate if sharing went okay:
image
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.

atomGit avatar atomGit commented on August 16, 2024

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.

janboddez avatar janboddez commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.