wordpress-webmention icon indicating copy to clipboard operation
wordpress-webmention copied to clipboard

Separate setting for which post types to _send_ webmentions for?

Open snarfed opened this issue 8 months ago • 13 comments

Hey guys! The current checkboxes for which post types to receive webmentions for are great. Any chance you might consider adding similar checkboxes for which post types to send webmentions for too?

Thanks in advance!

snarfed avatar Apr 24 '25 23:04 snarfed

We have this for acceptance. I have to look to see if that feature covers sending

dshanske avatar Apr 25 '25 01:04 dshanske

Right! My request here is to have separate settings for receiving and sending.

snarfed avatar Apr 25 '25 14:04 snarfed

can you elaborate on that a bit? what is the specific usecase?

pfefferle avatar Apr 25 '25 15:04 pfefferle

Mostly Bridgy Fed syndication. I link to it from some of my pages, eg https://snarfed.org/resume , but they're not posts, so I don't want to federate them as AP posts.

If you all decide this isn't worth a user-facing setting, I'm happy to do it via a filter or hook if that's possible!

snarfed avatar Apr 25 '25 16:04 snarfed

Oh now I see! Do you think we could simply use the setting to handle both ways at the same time? Is there a case you want to send but not receive or vice versa?

pfefferle avatar Apr 25 '25 16:04 pfefferle

I guess my ideal solution would be a blocklist of domains to never send webmentions to. If I had that, I'd put fed.brid.gy into it, and then I'd be ok with both sending and receiving webmentions for pages.

If not that, I think I'd prefer to receive webmentions for pages, but not send them.

snarfed avatar Apr 25 '25 16:04 snarfed

Btw, this is definitely my fault in the first place for abusing webmentions as the trigger for Bridgy Publish and Bridgy Fed federation for web. Sorry about that.

snarfed avatar Apr 25 '25 17:04 snarfed

I think we can do something in this area.

With blocklists...it is confusing to have so many

I want to think about some reasonable moderation settings... maybe study some similar features in other software

dshanske avatar Apr 25 '25 18:04 dshanske

Wait @dshanske did this get implemented?!

snarfed avatar Jul 05 '25 20:07 snarfed

@snarfed Sorry, closed the wrong one. I merged the per post one. This is the global default one.

dshanske avatar Jul 05 '25 20:07 dshanske

@snarfed have you tried to unhook add_action( 'publish_' . $post_type, array( static::class, 'publish_hook' ), 3 );???

Like for example remove_action( 'publish_page', array( \Webmention\Sender::class, 'publish_hook' ), 3 );

pfefferle avatar Jul 06 '25 11:07 pfefferle

And thanks @pfefferle ! I haven't tried that yet, but I will.

snarfed avatar Jul 06 '25 16:07 snarfed

@pfefferle I tried adding this to my local WordPress's functions.php, but when I tested, it still sent webmentions from pages. Am I maybe escaping \Webmention\Sender wrong? I'm not familiar with that namespace syntax.

remove_action( 'publish_page', array( \Webmention\Sender::class, 'publish_hook' ), 3 );
remove_action( 'trashed_page', array( \Webmention\Sender::class, 'trash_hook' ) );

snarfed avatar Jul 26 '25 02:07 snarfed