dshanske / syndication-links

Add and Display Syndication Links in WordPress
https://wordpress.org/plugins/syndication-links/
GNU General Public License v2.0
28 stars 13 forks source link

Option to default providers on for all posts #173

Open snarfed opened 1 year ago

snarfed commented 1 year ago

I want to send pretty much all of my posts to Bridgy Fed, so I'm looking for a way to default it to on (checked) for all posts. I especially want this because I use https://wordpress.org/plugins/indieweb-press-this/, and the Synd Links providers don't show up in the Press This UI.

I tried this, but it didn't work:

function always_bridgy_fed( $checked, $uid = null, $post_ID = null ) {
    return ( $uid == 'bridgy-fed' ) ? true : $checked;
}
add_filter('syndication_link_checked', 'always_bridgy_fed');

Thanks in advance!

dshanske commented 1 year ago

I will be looking at this.

dshanske commented 1 year ago

@snarfed Shouldn't it be:

add_filter('syndication_link_checked', 'always_bridgy_fed', 10, 3);

snarfed commented 1 year ago

@dshanske ahhh that did it, thank you!

I'll still hope for official support in the plugin, but still, awesome, glad this workaround works now.

dshanske commented 1 year ago

@snarfed I really want to address in a more granular way ala #89

dshanske commented 1 year ago

I don't like the idea of it being always for all posts.

dshanske commented 1 year ago

There's also this. https://github.com/indieweb/micropub-extensions/issues/23

dshanske commented 1 year ago

The checkbox system is based on the Micropub system it integrates into

snarfed commented 1 year ago

Alas, the custom filter above works in the standard editor, but not in the Press This editor, probably because the Synd Links UI doesn't show up there, so it doesn't render the checkboxes or run the filter at all. So yeah, I'd definitely like a more built in way to do this. Per category or tag or anything else is fine, as long as it's automatic.

dshanske commented 1 year ago

@snarfed Just need to come up with a good idea. As for Press This, I should check the code to see if I can add it in there.

snarfed commented 1 year ago

OK! Re Press This, if you do it underneath the UI, ie not specifically dependent on checkboxes or any other specific HTML elements in the editor, then you won't have to worry about Press This, the mobile app, or any of the many other UIs.

For example, say a provider is configured in settings to default to enabled, either always for a given category/tag. When a post is published or updated, if the request explicitly enables or disables that provider (eg in the standard editor), then you obey that. Otherwise, if it doesn't explicitly do either, then you use the default.

dshanske commented 1 year ago

Might not be the next release, which will be tying up some loose ends for users.

snarfed commented 1 year ago

This is still grating on me every day. Thanks in advance for looking at this eventually!